Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: xilinx: make sure pipe clock is deselected in usb2 only mode

When the USB3 PHY is not defined in the Linux device tree, there could
still be a case where there is a USB3 PHY active on the board and enabled
by the first stage bootloader. If serdes clock is being used then the USB
will fail to enumerate devices in 2.0 only mode.

To solve this, make sure that the PIPE clock is deselected whenever the
USB3 PHY is not defined and guarantees that the USB2 only mode will work
in all cases.

Fixes: 9678f3361afc ("usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode")
Cc: stable@vger.kernel.org
Signed-off-by: Neal Frager <neal.frager@amd.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Acked-by: Peter Korsgaard <peter@korsgaard.com>
Link: https://lore.kernel.org/r/1733163111-1414816-1-git-send-email-radhey.shyam.pandey@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Neal Frager and committed by
Greg Kroah-Hartman
a48f744b d2ec94fb

+4 -1
+4 -1
drivers/usb/dwc3/dwc3-xilinx.c
··· 121 121 * in use but the usb3-phy entry is missing from the device tree. 122 122 * Therefore, skip these operations in this case. 123 123 */ 124 - if (!priv_data->usb3_phy) 124 + if (!priv_data->usb3_phy) { 125 + /* Deselect the PIPE Clock Select bit in FPD PIPE Clock register */ 126 + writel(PIPE_CLK_DESELECT, priv_data->regs + XLNX_USB_FPD_PIPE_CLK); 125 127 goto skip_usb3_phy; 128 + } 126 129 127 130 crst = devm_reset_control_get_exclusive(dev, "usb_crst"); 128 131 if (IS_ERR(crst)) {