Skip to content

Commit f2d797f

Browse files
committed
Revert "usb: dwc2: hcd: Fix GetPortStatus & SetPortFeature"
See: #7349 This reverts commit a8d3e4a.
1 parent a72a008 commit f2d797f

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

drivers/usb/dwc2/hcd.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,9 +3583,11 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
35833583
port_status |= USB_PORT_STAT_C_OVERCURRENT << 16;
35843584
}
35853585

3586-
if (dwc2_is_device_mode(hsotg)) {
3586+
if (!hsotg->flags.b.port_connect_status) {
35873587
/*
3588-
* Just return 0's for the remainder of the port status
3588+
* The port is disconnected, which means the core is
3589+
* either in device mode or it soon will be. Just
3590+
* return 0's for the remainder of the port status
35893591
* since the port register can't be read if the core
35903592
* is in device mode.
35913593
*/
@@ -3655,11 +3657,13 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq,
36553657
if (wvalue != USB_PORT_FEAT_TEST && (!windex || windex > 1))
36563658
goto error;
36573659

3658-
if (dwc2_is_device_mode(hsotg)) {
3660+
if (!hsotg->flags.b.port_connect_status) {
36593661
/*
3660-
* Just return 0's for the remainder of the port status
3661-
* since the port register can't be read if the core
3662-
* is in device mode.
3662+
* The port is disconnected, which means the core is
3663+
* either in device mode or it soon will be. Just
3664+
* return without doing anything since the port
3665+
* register can't be written if the core is in device
3666+
* mode.
36633667
*/
36643668
break;
36653669
}

0 commit comments

Comments
 (0)