Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7992ce5f authored by Jack Pham's avatar Jack Pham Committed by Hemant Kumar
Browse files

usb: dwc3-msm: Fix SuperSpeed when SuperSpeedPlus is supported



On DWC 3.1 IP, maximum_speed may be USB_SPEED_SUPER_PLUS. There
are several places where this value is using an equals comparison
with USB_SPEED_SUPER, which will fail when speed is SSP, hence
avoiding sequence needed to allow SuperSpeed operation. The
comparisons should be changed from == to >=.

Change-Id: Id43290379f1977ef181756ca77f43b3bb5d277d7
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 50980939
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -158,12 +158,8 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
	int		retries = 1000;
	int		ret;

	/* Reset PHYs */
	/* Reset and initialize PHYs */
	usb_phy_reset(dwc->usb2_phy);

	if (dwc->maximum_speed == USB_SPEED_SUPER)
		usb_phy_reset(dwc->usb3_phy);

	ret = usb_phy_init(dwc->usb2_phy);
	if (ret) {
		pr_err("%s: usb_phy_init(dwc->usb2_phy) returned %d\n",
@@ -171,9 +167,10 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
		return ret;
	}

	if (dwc->maximum_speed == USB_SPEED_HIGH)
	if (dwc->maximum_speed <= USB_SPEED_HIGH)
		goto generic_phy_init;

	usb_phy_reset(dwc->usb3_phy);
	ret = usb_phy_init(dwc->usb3_phy);
	if (ret == -EBUSY) {
		/*
@@ -796,7 +793,7 @@ int dwc3_core_init(struct dwc3 *dwc)
	/* 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)
		if (dwc->maximum_speed >= USB_SPEED_SUPER)
			dwc->maximum_speed = USB_SPEED_HIGH;
	}