linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yegor Yefremov <yegorslists@googlemail.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Johan Hovold <johan@kernel.org>,
	Sebastian Reichel <sre@kernel.org>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	vkoul@kernel.org, Bin Liu <b-liu@ti.com>,
	linux-usb <linux-usb@vger.kernel.org>,
	Andrey Skvortsov <andrej.skvortzov@gmail.com>,
	Giulio Benetti <giulio.benetti@benettiengineering.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: Re: musb: cppi41: broken high speed FTDI functionality when connected to musb directly
Date: Mon, 21 Oct 2019 10:39:21 +0200	[thread overview]
Message-ID: <CAGm1_kvK+Xkd0Yx8AUvTPMejLTm7jr5+2dzrwNLkG2ivuUC6bw@mail.gmail.com> (raw)
In-Reply-To: <CAGm1_kt4W+2uN_6WduUtR+NwKCmQMZwNRHQQ7kVJt0PqmoobaA@mail.gmail.com>

Hi Tony,

On Thu, Oct 3, 2019 at 10:39 AM Yegor Yefremov
<yegorslists@googlemail.com> wrote:
>
> Hi Tony,
>
> On Wed, Oct 2, 2019 at 6:52 PM Tony Lindgren <tony@atomide.com> wrote:
> >
> > * Yegor Yefremov <yegorslists@googlemail.com> [191002 06:57]:
> > > On Wed, Oct 2, 2019 at 12:03 AM Tony Lindgren <tony@atomide.com> wrote:
> > > > The other way to fix this would be to just wake up cpp41 in
> > > > cppi41_dma_prep_slave_sg() and return NULL so that we can
> > > > have musb_ep_program() continue with PIO while cppi41 is
> > > > asleep.
> > > >
> > > > Anyways, care to try it out and see if it fixes your issue?
> > >
> > > The fix is working but on the first invocation, I get this output
> > > (minicom provokes the same output):
> >
> > > # serialtest.py -c 2 /dev/ttyUSB0 /dev/ttyUSB0
> > ...
> > > [  210.940612] [<c065fc94>] (__rpm_callback) from [<c065fd60>]
> > > (rpm_callback+0x20/0x80)
> > > [  210.948402] [<c065fd60>] (rpm_callback) from [<c065f7cc>]
> > > (rpm_resume+0x468/0x7a0)
> > > [  210.956018] [<c065f7cc>] (rpm_resume) from [<c065fb50>]
> > > (__pm_runtime_resume+0x4c/0x64)
> > > [  210.964086] [<c065fb50>] (__pm_runtime_resume) from [<bf020940>]
> > > (cppi41_dma_prep_slave_sg+0x20/0xfc [cppi41])
> >
> > OK so that won't work, thanks for testing. Here's the alternative
> > patch to try along the lines described above that just wakes up
> > cppi41 and returns NULL so musb_ep_program() can continue with PIO
> > until cppi41 is awake.
>
> I'm out of the office for some weeks and don't have access to my hw.
> I'll make the test as soon as I'm back.

I've tested your patch with both systems (with and without a hub) and
everything is working as expected.

Thanks.
Yegor

> > 8< -----------------------
> > diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c
> > --- a/drivers/dma/ti/cppi41.c
> > +++ b/drivers/dma/ti/cppi41.c
> > @@ -586,9 +586,22 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg(
> >         enum dma_transfer_direction dir, unsigned long tx_flags, void *context)
> >  {
> >         struct cppi41_channel *c = to_cpp41_chan(chan);
> > +       struct dma_async_tx_descriptor *txd = NULL;
> > +       struct cppi41_dd *cdd = c->cdd;
> >         struct cppi41_desc *d;
> >         struct scatterlist *sg;
> >         unsigned int i;
> > +       int error;
> > +
> > +       error = pm_runtime_get(cdd->ddev.dev);
> > +       if (error < 0) {
> > +               pm_runtime_put_noidle(cdd->ddev.dev);
> > +
> > +               return NULL;
> > +       }
> > +
> > +       if (cdd->is_suspended)
> > +               goto err_out_not_ready;
> >
> >         d = c->desc;
> >         for_each_sg(sgl, sg, sg_len, i) {
> > @@ -611,7 +624,13 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg(
> >                 d++;
> >         }
> >
> > -       return &c->txd;
> > +       txd = &c->txd;
> > +
> > +err_out_not_ready:
> > +       pm_runtime_mark_last_busy(cdd->ddev.dev);
> > +       pm_runtime_put_autosuspend(cdd->ddev.dev);
> > +
> > +       return txd;
> >  }
> >
> >  static void cppi41_compute_td_desc(struct cppi41_desc *d)
> > --
> > 2.23.0

  reply	other threads:[~2019-10-21  8:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-27  8:18 musb: cppi41: broken high speed FTDI functionality when connected to musb directly Yegor Yefremov
2019-09-27 12:30 ` Yegor Yefremov
2019-09-27 15:19   ` Tony Lindgren
2019-09-27 15:57     ` Tony Lindgren
2019-09-28 16:09       ` Yegor Yefremov
2019-09-30  6:59         ` Yegor Yefremov
2019-09-30  8:19           ` Yegor Yefremov
2019-09-30 14:57             ` Tony Lindgren
2019-09-30 15:23               ` Tony Lindgren
2019-09-30 19:54                 ` Sebastian Reichel
2019-10-01  8:03                   ` Johan Hovold
2019-10-01  9:19                     ` Yegor Yefremov
2019-10-01 16:43                       ` Tony Lindgren
2019-10-01 22:03                         ` Tony Lindgren
2019-10-02  6:56                           ` Yegor Yefremov
2019-10-02 16:52                             ` Tony Lindgren
2019-10-03  8:39                               ` Yegor Yefremov
2019-10-21  8:39                                 ` Yegor Yefremov [this message]
2019-10-22 14:56                                   ` Tony Lindgren

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=CAGm1_kvK+Xkd0Yx8AUvTPMejLTm7jr5+2dzrwNLkG2ivuUC6bw@mail.gmail.com \
    --to=yegorslists@googlemail.com \
    --cc=andrej.skvortzov@gmail.com \
    --cc=b-liu@ti.com \
    --cc=bigeasy@linutronix.de \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=johan@kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.ujfalusi@ti.com \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    --cc=vkoul@kernel.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).