[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1405081019230.1087-100000@iolanthe.rowland.org>
Date: Thu, 8 May 2014 10:25:46 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Zhuang Jin Can <jin.can.zhuang@...el.com>
cc: Felipe Balbi <balbi@...com>, USB list <linux-usb@...r.kernel.org>,
<linux-omap@...r.kernel.org>,
Kernel development list <linux-kernel@...r.kernel.org>,
<liping.zhou@...el.com>, <david.a.cohen@...ux.intel.com>
Subject: Re: [PATCH] usb: dwc3: ep0: fix delayed status is queued too early
On Thu, 8 May 2014, Zhuang Jin Can wrote:
> > When the host already timed out the control transfer and started a new
> > one. Here's what I'm talking about:
> >
> > Host sends a Set-Configuration request.
> >
> > The UDC driver calls the gadget driver's setup function.
> >
> > The setup function returns DELAYED_STATUS.
> >
> > After a few seconds, the host gets tired of waiting and
> > sends a Get-Descriptor request
> My understanding is dwc3 will return NYET to host for this
> Get-Descriptor request transaction, as dwc3 is still in STATUS phase,
> there's no buffer to receive anything in ep0-out.
dwc3 _cannot_ return NYET to a SETUP packet. The USB protocol does not
allow it. A device must always respond to SETUP with ACK.
On the other hand, dwc3 _can_ return NYET to the token packet that
follows the SETUP transaction. That's what it should do. But at this
point it should be in the DATA stage, not the STATUS stage. Receiving
a SETUP packet should abort a STATUS stage.
> And your below
> comments is not applicapable to dwc3.
True, they apply to composite.c rather than dwc3. However, they
address an issue very similar to your patch, so I raised this topic in
your email thread.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists