[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1594282250-25544-1-git-send-email-chunfeng.yun@mediatek.com>
Date: Thu, 9 Jul 2020 16:10:50 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Felipe Balbi <balbi@...nel.org>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Matthias Brugger <matthias.bgg@...il.com>,
<linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>,
Chunfeng Yun <chunfeng.yun@...iatek.com>
Subject: [RFC PATCH] usb: dwc3: fix maximum_speed check for usb2.0-only core
The maximum_speed will be USB_SPEED_SUPER_PLUS, but the
maximum_speed check for usb2.0-only core doesn't consider it,
so fix it, and move the ckeck into dwc3_check_params().
Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
---
Note:
When I look at the code, find that this may be a problem, but no
platform to test it.
---
drivers/usb/dwc3/core.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 25c686a7..ffd5ab3 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -930,13 +930,6 @@ static int dwc3_core_init(struct dwc3 *dwc)
*/
dwc3_writel(dwc->regs, DWC3_GUID, LINUX_VERSION_CODE);
- /* Handle USB2.0-only core configuration */
- if (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
- DWC3_GHWPARAMS3_SSPHY_IFC_DIS) {
- if (dwc->maximum_speed == USB_SPEED_SUPER)
- dwc->maximum_speed = USB_SPEED_HIGH;
- }
-
ret = dwc3_phy_setup(dwc);
if (ret)
goto err0;
@@ -1426,6 +1419,13 @@ static void dwc3_check_params(struct dwc3 *dwc)
break;
}
+
+ /* Handle USB2.0-only core configuration */
+ if (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
+ DWC3_GHWPARAMS3_SSPHY_IFC_DIS) {
+ if (dwc->maximum_speed > USB_SPEED_HIGH)
+ dwc->maximum_speed = USB_SPEED_HIGH;
+ }
}
static int dwc3_probe(struct platform_device *pdev)
--
1.9.1
Powered by blists - more mailing lists