diff options
author | Roger Quadros <rogerq@kernel.org> | 2023-05-28 18:48:12 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-28 17:05:32 +0100 |
commit | b4a4be8471846d96b0ac52a0e9e7d48005cc97e2 (patch) | |
tree | 19645be13cb56db9a3ce07c534b0d5dbf3e653be /drivers/usb | |
parent | 7e530d32a3655f15f1cf92e8aabed1bc3a21ee36 (diff) | |
download | linux-stable-b4a4be8471846d96b0ac52a0e9e7d48005cc97e2.tar.gz linux-stable-b4a4be8471846d96b0ac52a0e9e7d48005cc97e2.tar.bz2 linux-stable-b4a4be8471846d96b0ac52a0e9e7d48005cc97e2.zip |
USB: fix up merge of 6.4-rc4 into usb-next
The merge of 6.4-rc4 got the changes in drivers/usb/dwc3/gadget.c
completely incorrect, so fix it up properly.
Link: https://lore.kernel.org/r/f604f836-7858-6140-4ec1-9ba95cba6991@kernel.org
Fixes: 7e530d32a365 ("Merge 6.4-rc4 into usb-next")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 7d59e0f43fda..578804dc29ca 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2702,13 +2702,17 @@ static int dwc3_gadget_soft_disconnect(struct dwc3 *dwc) static int dwc3_gadget_soft_connect(struct dwc3 *dwc) { + int ret; + /* * In the Synopsys DWC_usb31 1.90a programming guide section * 4.1.9, it specifies that for a reconnect after a * device-initiated disconnect requires a core soft reset * (DCTL.CSftRst) before enabling the run/stop bit. */ - dwc3_core_soft_reset(dwc); + ret = dwc3_core_soft_reset(dwc); + if (ret) + return ret; dwc3_event_buffers_setup(dwc); __dwc3_gadget_start(dwc); @@ -2753,25 +2757,11 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on) synchronize_irq(dwc->irq_gadget); - if (!is_on) { + if (!is_on) ret = dwc3_gadget_soft_disconnect(dwc); - } else { - /* - * In the Synopsys DWC_usb31 1.90a programming guide section - * 4.1.9, it specifies that for a reconnect after a - * device-initiated disconnect requires a core soft reset - * (DCTL.CSftRst) before enabling the run/stop bit. - */ - ret = dwc3_core_soft_reset(dwc); - if (ret) - goto done; - - dwc3_event_buffers_setup(dwc); - __dwc3_gadget_start(dwc); - ret = dwc3_gadget_run_stop(dwc, true); - } + else + ret = dwc3_gadget_soft_connect(dwc); -done: pm_runtime_put(dwc->dev); return ret; |