public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>,
	balbi@ti.com, "greg@kroah.com" <greg@kroah.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	David Brownell <dbrownell@users.sourceforge.net>,
	"Gadiyar, Anand" <gadiyar@ti.com>,
	Mike Frysinger <vapier@gentoo.org>
Subject: Re: [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx
Date: Wed, 15 Sep 2010 17:06:46 +0400	[thread overview]
Message-ID: <4C90C4E6.9000703@ru.mvista.com> (raw)
In-Reply-To: <AANLkTinPVUBNJoOR496KgSy2TT0f6i1f5xEKVhKod2R=@mail.gmail.com>

Ming Lei wrote:
> Hi All,

> In another thread, Sergei pointed out there is a ZLP issue in musb_g_tx:

> Sergei Shtylyov <sshtylyov@mvista.com> wrote:
>> Hello.

>> On 15-09-2010 14:05, Felipe Balbi wrote:

>>>> I didn't say it was duplicate for DMA, just too late.

>>> how come ? we need to send ZLP before giving back the request.

>>     Well, look at the code ionce again. We need to send ZLP *after*
>> request->actual == request->length, but as the check is inserted
>> after the ZLP send, ZLP *may* be sent once the first DMA completes,
>> not the last.

>> WBR, Sergei

> balbi also confirmed that is is really a problem.

> I also have two related questions below for the problem:

> 1),  why is the check for "is_dma" needed here?

>       if (is_dma || request->actual == request->length) {
>            ....
>       }

    I'm not sure -- it seems erratic.

> 2), why is a zlp needed in the case below?
> 
>       #ifdef CONFIG_USB_INVENTRA_DMA
>                   || (is_dma && (!dma->desired_mode ||
>                      (request->actual & (musb_ep->packet_sz - 1))))
>      #endif

> Seems no request->zero is set to ask for zlp explicitly in
> the case above.

    This is not for ZLP -- this is here to set TXPktRdy for the last short 
packet in the Inventra DMA mode 0 that doesn't set TXPktRdy in such case.

> IMO, it is not difficult to give a good fix for the ZLP problem
> if the two questions are clear.

WBR, Sergei


      parent reply	other threads:[~2010-09-15 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15 10:53 [Discussion] USB: musb-gadget: how to fix ZLP issue in musb_g_tx Ming Lei
2010-09-15 10:56 ` Felipe Balbi
2010-09-15 11:02   ` Ming Lei
2010-09-15 11:07     ` Felipe Balbi
2010-09-15 13:10       ` Sergei Shtylyov
2010-09-16  6:05         ` Felipe Balbi
2010-09-16  6:15           ` Gadiyar, Anand
2010-09-16  6:22             ` Felipe Balbi
2010-09-16  6:54               ` Ming Lei
2010-09-16 11:03           ` Sergei Shtylyov
2010-09-15 11:14   ` Ming Lei
2010-09-15 13:06 ` Sergei Shtylyov [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=4C90C4E6.9000703@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=balbi@ti.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gadiyar@ti.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    --cc=vapier@gentoo.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