usb: dwc3: gadget: Only End Transfer for ep0 data phase
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Fri, 22 Apr 2022 02:22:57 +0000 (19:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 May 2022 20:03:24 +0000 (22:03 +0200)
commitace17b6ee4f92ab0375d12a1b42494f8590a96b6
tree64e6bc9ed49dc674d274ee6a7ef6ed6d7d47112a
parentc96683798e272366866a5c0ce3073c0b5a256db7
usb: dwc3: gadget: Only End Transfer for ep0 data phase

The driver shouldn't be able to issue End Transfer to the control
endpoint at anytime. Typically we should only do so in error cases such
as invalid/unexpected direction of Data Phase as described in the
control transfer flow of the programming guide. It _may_ end started
data phase during controller deinitialization from soft disconnect or
driver removal. However, that should not happen because the driver
should be maintained in EP0_SETUP_PHASE during driver tear-down. On
soft-connect, the controller should be reset from a soft-reset and there
should be no issue starting the control endpoint.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/3c6643678863a26702e4115e9e19d7d94a30d49c.1650593829.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c