[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230818204610.byxapbhaqxxnvqvm@synopsys.com>
Date: Fri, 18 Aug 2023 20:46:14 +0000
From: Thinh Nguyen <Thinh.Nguyen@...opsys.com>
To: Alan Stern <stern@...land.harvard.edu>
CC: Andrey Konovalov <andreyknvl@...il.com>,
Felipe Balbi <balbi@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
USB list <linux-usb@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: dwc3: unusual handling of setup requests with wLength == 0
On Fri, Aug 18, 2023, Thinh Nguyen wrote:
> >
> > Right. The difficulty doesn't involve the communication between the HCD
> > and the UDC hardware; it involves the communication between the UDC
> > driver and the gadget driver. Somehow they need to synchronize so that
> > when the gadget driver queues a usb_request, the UDC driver can tell
> > whether the request was meant for the earlier aborted control transfer
> > or the new active one. This can matter if the gadget driver has a
> > separate control thread (a work routine or a kthread, for example) that
> > could be queuing requests while the ->setup() callback is running.
> >
>
> Perhaps this can be improved and enforced from the core. At the moment,
> it should not be a problem for gadget driver with dwc3 driver (with a
> minor fix due to missing check).
>
Perhaps I'm too quick to respond to overlook what you've said. I've only
thinking about the UDC driver sequence and not the gadget driver
handling the givebacks. Yes if the gadget driver has a separate control
thread, that may be problematic.
BR,
Thinh
Powered by blists - more mailing lists