Skip to content

Commit 1e48fd0

Browse files
Ryceancurryvinodkoul
authored andcommitted
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: 5095d04 ("phy: usb: Turn off phy when port is in suspend") Signed-off-by: Justin Chen <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 2d0f973 commit 1e48fd0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ static void xhci_soft_reset(struct brcm_usb_init_params *params,
153153
} else {
154154
USB_CTRL_SET(ctrl, USB_PM, XHC_SOFT_RESETB);
155155
/* Required for COMMONONN to be set */
156-
USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, U2_FREECLK_EXISTS);
156+
if (params->supported_port_modes != USB_CTLR_MODE_DRD)
157+
USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG,
158+
U2_FREECLK_EXISTS);
157159
}
158160
}
159161

@@ -328,8 +330,12 @@ static void usb_init_common_7216(struct brcm_usb_init_params *params)
328330
/* 1 millisecond - for USB clocks to settle down */
329331
usleep_range(1000, 2000);
330332

331-
/* Disable PHY when port is suspended */
332-
USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
333+
/*
334+
* Disable PHY when port is suspended
335+
* Does not work in DRD mode
336+
*/
337+
if (params->supported_port_modes != USB_CTLR_MODE_DRD)
338+
USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN);
333339

334340
usb_wake_enable_7216(params, false);
335341
usb_init_common(params);

0 commit comments

Comments
 (0)