From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Bin Liu <b-liu-l0cyMroinI0@public.gmane.org>,
Grygorii Strashko
<grygorii.strashko-l0cyMroinI0@public.gmane.org>,
Dan Williams
<dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Felipe Balbi
<felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Peter Ujfalusi <peter.ujfalusi-l0cyMroinI0@public.gmane.org>,
Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
Sebastian Andrzej Siewior
<bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Andy Shevchenko
<andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kevin Hilman <khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
Patrick Titiano
<ptitiano-rdvid1DuHRBWk0Htik3J/w@public.gmane.org>,
Sergei Shtylyov
<sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
Subject: Re: [PATCHv2] dmaengine: cppi41: Fix oops in cppi41_runtime_resume
Date: Tue, 17 Jan 2017 12:40:22 -0800 [thread overview]
Message-ID: <20170117204022.GS7403@atomide.com> (raw)
In-Reply-To: <20170117194614.GB17480@uda0271908>
* Bin Liu <b-liu-l0cyMroinI0@public.gmane.org> [170117 11:47]:
> On Tue, Jan 17, 2017 at 09:39:23AM -0800, Tony Lindgren wrote:
> > * Bin Liu <b-liu-l0cyMroinI0@public.gmane.org> [170117 08:49]:
> > > On Tue, Jan 17, 2017 at 08:31:03AM -0800, Tony Lindgren wrote:
> > > > * Bin Liu <b-liu-l0cyMroinI0@public.gmane.org> [170117 08:22]:
> > > > > On Tue, Jan 17, 2017 at 08:11:39AM -0800, Tony Lindgren wrote:
> > > > > > * Bin Liu <b-liu-l0cyMroinI0@public.gmane.org> [170117 05:00]:
> > > > > > > On Mon, Jan 16, 2017 at 03:54:29PM -0800, Tony Lindgren wrote:
> > > > > > > > Anyways, for the -rc series oops, we can just leave out the WARN_ON
> > > > > > > > parts for now until drivers/usb/musb/musb_cppi41.c is fixed too.
> > > > > > >
> > > > > > > Giving that cppi is a submodule inside the usb subsysytem and it does't
> > > > > > > have separate power rail or clock, what is the benefit to adding runtime
> > > > > > > PM in the cppi driver?
> > > > > >
> > > > > > Good question. We need at least minimal support to enable things for
> > > > > > probe and then idle cppi41 properly if only cppi41.ko is loaded with no
> > > > > > USB modules.
> > > > > >
> > > > > > But yeah now that musb does runtime PM based on the cable detection, we
> > > > > > pretty much guarantee that cppi41 is always enabled when USB is in use.
> > > > > >
> > > > > > And if there are no other devices using cppi41 dma on davinci, we can
> > > > > > simplify the PM runtime a bit for cppi41.
> > > > >
> > > > > This might be a good idea. I didn't have much time to play with this
> > > > > cppi41 runtime PM, but it seems I am having more issues than you and
> > > > > others seeing.
> > > >
> > > > What kind of additional issues are you seeing not described in the $subject
> > > > patch?
> > >
> > > I didn't take a note and don't remember if those are in the $subject
> > > patch. But
> > >
> > > - enumeration begining with a reset that the device doesn't accept
> > > address X, error code -71; or
> >
> > Some of this could be fixed by $subject patch if caused by a race.
> > Some of it I'm suspecting might be a different issue where cppi41 dma
> > will just hang until the device is disconnected on 1 sized in dma transfer.
> > See the experimental patch below.
> >
> > > - console fooding with cppi error code -115 after thumb drive enumeration.
> >
> > This should get fixed with the $subject patch if we additionally set
> > the autosuspend_delay to something sufficient, like 1000.
> >
> > > Again, I only tried for a few minutes and didn't take a note, since I
> > > don't have time to look at this ATM.
> >
> > Well I'll post what I think we should fix for the -rc series for cppi41.
> > If you can then please test that a bit and see if it works. Assuming
> > things work, then all the other changes can be done later on with no
> > rush.
>
> Sure, I will spend some time on this tomorrow morning, and let you know.
>
> >
> > Regards,
> >
> > Tony
> >
> > 8< ----------------------------------------
> > diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> > --- a/drivers/usb/musb/musb_host.c
> > +++ b/drivers/usb/musb/musb_host.c
> > @@ -751,6 +751,15 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
> > hw_ep->tx_channel = NULL;
> > }
> >
> > + /*
> > + * At least cppi41 in dma will just hang with size of 1 until the
> > + * device is connected. For sizes less than 8 it seems to take a
> > + * long time to complete. Let's use minimum size of 16 to avoid
> > + * tiny in DMA transfers.
> > + */
> > + if (!is_out && (len < 16))
> > + use_dma = 0;
>
> I think you also need to add more cleanup in here when not use dma,
> as in musb_ep_program():
>
> 746 if (is_out && !len) {
> 747 use_dma = 0;
> 748 csr = musb_readw(epio, MUSB_TXCSR);
> 749 csr &= ~MUSB_TXCSR_DMAENAB;
> 750 musb_writew(epio, MUSB_TXCSR, csr);
> 751 hw_ep->tx_channel = NULL;
> 752 }
Oh OK. Yeah this one is in the mysteries to unravel category. And I noticed
the -71 resets with another USB mass storage device I tried with this patch
so clearly not the right fix for that one.
Regards,
Tony
--
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
prev parent reply other threads:[~2017-01-17 20:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 18:01 [PATCHv2] dmaengine: cppi41: Fix oops in cppi41_runtime_resume Tony Lindgren
[not found] ` <20170113180132.9188-1-tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-13 18:36 ` Grygorii Strashko
[not found] ` <d6fddff7-3d00-1de1-ebbf-ee2a949a6284-l0cyMroinI0@public.gmane.org>
2017-01-13 19:01 ` Tony Lindgren
[not found] ` <20170113190126.GE2630-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-13 19:53 ` Grygorii Strashko
[not found] ` <c80b51a2-1acd-914c-17b8-32754ea9ce3e-l0cyMroinI0@public.gmane.org>
2017-01-13 19:57 ` Grygorii Strashko
[not found] ` <c58cebdf-5752-098a-8b3e-de99f6af14af-l0cyMroinI0@public.gmane.org>
2017-01-13 21:36 ` Grygorii Strashko
[not found] ` <c1bbb731-940e-6d04-f127-222050d831b8-l0cyMroinI0@public.gmane.org>
2017-01-13 21:59 ` Tony Lindgren
[not found] ` <20170113215936.GF2630-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-16 23:33 ` Tony Lindgren
[not found] ` <20170116233329.GF7403-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-16 23:54 ` Tony Lindgren
[not found] ` <20170116235428.GG7403-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-17 12:59 ` Bin Liu
2017-01-17 16:11 ` Tony Lindgren
[not found] ` <20170117161138.GJ7403-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-17 16:21 ` Bin Liu
2017-01-17 16:31 ` Tony Lindgren
[not found] ` <20170117163103.GO7403-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-17 16:48 ` Bin Liu
2017-01-17 17:39 ` Tony Lindgren
[not found] ` <20170117173922.GR7403-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2017-01-17 19:46 ` Bin Liu
2017-01-17 20:40 ` Tony Lindgren [this message]
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=20170117204022.GS7403@atomide.com \
--to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
--cc=andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=b-liu-l0cyMroinI0@public.gmane.org \
--cc=bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
--cc=johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=khilman-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nsekhar-l0cyMroinI0@public.gmane.org \
--cc=peter.ujfalusi-l0cyMroinI0@public.gmane.org \
--cc=ptitiano-rdvid1DuHRBWk0Htik3J/w@public.gmane.org \
--cc=sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org \
--cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=zonque-Re5JQEeQqe8AvxtiuMwx3w@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).