From f2d797f4aa3824c880823207a5efe9f70fcb7978 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 17 May 2026 22:14:43 +0100 Subject: [PATCH] Revert "usb: dwc2: hcd: Fix GetPortStatus & SetPortFeature" See: https://github.com/raspberrypi/linux/issues/7349 This reverts commit a8d3e4a734599c7d0f6735f8db8a812e503395dd. --- drivers/usb/dwc2/hcd.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 9b8d28f2eb4d29..59f7e2cc1409c8 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -3583,9 +3583,11 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq, port_status |= USB_PORT_STAT_C_OVERCURRENT << 16; } - if (dwc2_is_device_mode(hsotg)) { + if (!hsotg->flags.b.port_connect_status) { /* - * Just return 0's for the remainder of the port status + * The port is disconnected, which means the core is + * either in device mode or it soon will be. Just + * return 0's for the remainder of the port status * since the port register can't be read if the core * is in device mode. */ @@ -3655,11 +3657,13 @@ static int dwc2_hcd_hub_control(struct dwc2_hsotg *hsotg, u16 typereq, if (wvalue != USB_PORT_FEAT_TEST && (!windex || windex > 1)) goto error; - if (dwc2_is_device_mode(hsotg)) { + if (!hsotg->flags.b.port_connect_status) { /* - * Just return 0's for the remainder of the port status - * since the port register can't be read if the core - * is in device mode. + * The port is disconnected, which means the core is + * either in device mode or it soon will be. Just + * return without doing anything since the port + * register can't be written if the core is in device + * mode. */ break; }