On Tue, Jan 24, 2023, Dan Scally wrote: > Hi Thinh > > > I'm trying to update the DWC3 driver to allow the status phase of a > transaction to be explicit; meaning the gadget driver has the choice to > either Ack or Stall _after_ the data phase so that the contents of the data > phase can be validated. I thought that I should be able to achieve this by > preventing dwc3_ep0_xfernotready() from calling dwc3_ep0_do_control_status() > (relying on an "explicit_status" flag added to the usb_request to decide > whether or not to do so) and then calling it manually later once the data > phase was validated by the gadget driver (or indeed userspace). A very > barebones version of my attempt to do that looks like this: > We shouldn't do this. At the protocol level, there must be better ways to do handshake than relying on protocol STALL _after_ the data stage. Note that not all controllers support this. Thanks, Thinh