Skip to contentSkip to conversation

phy: usb: disable COMMONONN for dual mode

PATCH Applied Justin Chen 3 participants 3 messages Oct 10, 2024 – Oct 12, 2024

Subsystems (2)
lore
Share & tools
lore

Justin Chen

author maintainer
#0 lore raw

PATCH 1/1 phy: usb: disable COMMONONN for dual mode

The COMMONONN bit suspends the phy when the port is put into a suspend state. However when the phy is shared between host and device in dual mode, this no longer works cleanly as there is no synchronization between the two.

Fixes 5095d045a962 ("phy: usb: Turn off phy when port is in suspend")
---
 drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c +9 -3
index 4c10cafded4e..950b7ae1d1a8 100644
@@ -153,7 +153,9 @@ static void xhci_soft_reset(struct brcm_usb_init_params *params,
 	} else {
 		USB_CTRL_SET(ctrl, USB_PM, XHC_SOFT_RESETB);
 		/* Required for COMMONONN to be set */
-		USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, U2_FREECLK_EXISTS);
+		if (params->supported_port_modes != USB_CTLR_MODE_DRD)
+			USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG,
+					   U2_FREECLK_EXISTS);
 	}
 }
 
@@ -328,8 +330,12 @@ static void usb_init_common_7216(struct brcm_usb_init_params *params)
 	/* 1 millisecond - for USB clocks to settle down */
 	usleep_range(1000, 2000);
 
-	/* Disable PHY when port is suspended */
-	USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
+	/*
+	 * Disable PHY when port is suspended
+	 * Does not work in DRD mode
+	 */
+	if (params->supported_port_modes != USB_CTLR_MODE_DRD)
+		USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
 
 	usb_wake_enable_7216(params, false);
 	usb_init_common(params);
Signature · 7 lines
2.34.1


-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Justin Chen

The COMMONONN bit suspends the phy when the port is put into a suspend state. However when the phy is shared between host and device in dual mode, this no longer works cleanly as there is no synchronization between the two.

Fixes 5095d045a962 ("phy: usb: Turn off phy when port is in suspend")
Signature · 6 lines
Florian

-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy
maintainer Applied
#2 lore raw
In reply to Justin Chen
Quoted 6 lines · Justin Chen

The COMMONONN bit suspends the phy when the port is put into a suspend state. However when the phy is shared between host and device in dual mode, this no longer works cleanly as there is no synchronization between the two.

Applied, thanks!

[1/1] phy: usb: disable COMMONONN for dual mode

      commit: 1e48fd0574ee697e87f9c9bbd64d9a121d271f7a

Best regards,

Signature · 8 lines
~Vinod



-- 
linux-phy mailing list
[email protected]
https://lists.infradead.org/mailman/listinfo/linux-phy