From: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Sebastian Andrzej Siewior
<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
neumann-SRDuVqtxQLSzQB+pC5nmwQ@public.gmane.org,
vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
balbi-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH 0/3] dma: cppi41: more suspend/resume patches
Date: Wed, 02 Oct 2013 13:07:12 +0200 [thread overview]
Message-ID: <524BFE60.6050707@gmail.com> (raw)
In-Reply-To: <20131002102033.GB16680-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
On 02.10.2013 12:20, Sebastian Andrzej Siewior wrote:
> * Daniel Mack | 2013-10-01 15:31:08 [+0200]:
>
>> Patch #3, however, gives me headaches. I can't fully explain what's
>> going on, but I can tell for sure that if fixes a problem that I stared
>> on for many hours.
>>
>> The problem is that on resume, the musb core will detect that some of
>> the suspended USB devices' endpoints are stalled. Which is something
>> that is unrelated to the dma driver, it just seems to be an expected
>> condition. That, however, makes the musb core call
>> cppi41_dma_channel_abort() -> cppi41_tear_down_chan(), which is
>> an otherwise untravelled code path. When that function is called for
>> a channel which has all of td_queued, td_seen and td_desc_seen set
>> to FALSE, I'm always getting a warning like this:
>>
>> [ 17.105981] ------------[ cut here ]------------
>> [ 17.110861] WARNING: CPU: 0 PID: 122 at drivers/dma/cppi41.c:644 cppi41_dma_control+0x378/0x3f8 [cppi41]()
>
> This is
> WARN_ON(!cdd->chan_busy[desc_num]);
>
> at the end of cppi41_stop_chan() right?
No, as stated, the line numbers in the kernel message are somewhat off
due to added debugging code. What kicks in here is this one:
if (!c->td_desc_seen) {
desc_phys = cppi41_pop_desc(cdd, c->q_comp_num);
if (desc_phys) {
__iormb();
WARN_ON(c->desc_phys != desc_phys);
c->td_desc_seen = 1;
}
}
> So you get the warning because
> you tried to stop a channel which was not busy. But then you should not
> be called at all because cppi41_dma_channel_abort() shouldn't call dma
> driver on idle channels.
However, I see nothing that forbids you from calling
dmaengine_terminate_all() on idle channels. If that's not handled
properly by the cppi driver, I'd say it needs fixing.
> How does your suspend & resume thingy work? Is it completly shutdown
> i.e. powered off? According to you earlier patches I would assume so. In
> that case the request is not enqueued and there is nothing to be removed
> from the engine, right?
No, my debugging showed that the channel has actually been prepared and
submitted before. It's just being torn down shortly after that. That's
what makes be believe in a race condition here.
> With the change you somehow get an interrupt that cleans up that slot.
Timing, I presume.
> The whole thing has been tested by manipulating the USB storage driver
> to enqueue more / less data then required by the protocol leading to a
> stall followed by an abort of the transfer. Let me re-do your suspend
> with the patches you made so far to check what is going on and if the
> "normal" transfer cancel is still working.
Ok, that sounds good.
Thanks,
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-10-02 11:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 13:31 [PATCH 0/3] dma: cppi41: more suspend/resume patches Daniel Mack
[not found] ` <1380634271-27588-1-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-01 13:31 ` [PATCH 1/3] dma: cppi41: restore more registers Daniel Mack
2013-10-01 13:31 ` [PATCH 2/3] dma: cppi41: use cppi41_pop_desc() where possible Daniel Mack
2013-10-01 13:31 ` [PATCH 3/3] dma: cppi41: move -EAGAIN in tear_down Daniel Mack
[not found] ` <1380634271-27588-4-git-send-email-zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-02 8:29 ` Sebastian Andrzej Siewior
2013-10-02 9:19 ` Daniel Mack
2013-10-02 10:25 ` Sebastian Andrzej Siewior
2013-10-02 11:38 ` Daniel Mack
2013-10-02 10:20 ` [PATCH 0/3] dma: cppi41: more suspend/resume patches Sebastian Andrzej Siewior
[not found] ` <20131002102033.GB16680-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-10-02 11:07 ` Daniel Mack [this message]
2013-10-02 12:57 ` Sebastian Andrzej Siewior
2013-10-09 6:41 ` Sebastian Andrzej Siewior
2013-10-09 7:23 ` Daniel Mack
[not found] ` <5255047A.5010609-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-09 7:28 ` Sebastian Andrzej Siewior
2013-10-09 7:31 ` Daniel Mack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=524BFE60.6050707@gmail.com \
--to=zonque-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=balbi-l0cyMroinI0@public.gmane.org \
--cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=neumann-SRDuVqtxQLSzQB+pC5nmwQ@public.gmane.org \
--cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).