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

Commit 6f504dca authored by Hemant Kumar's avatar Hemant Kumar Committed by Mayank Rana
Browse files

usb: dwc3: Set core clk rate to default upon device remove notification



commit 1eec2157d84dcb ("usb: dwc3: Update core clock rate based on
USB port speed.") only sets clk rate for HS/FS/LS device add notification.
In case super speed device is plugged in after LS/FS/HS device unplug in
absence of runtime suspend, core clk rate remains at high speed core clk
rate. Fix this issue by setting the core clk rate back to default when
a device is being removed from root hub.

Change-Id: I0ac37b7ff08a9a297441304eb2cfaff398d44bb9
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 8e6a11e2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3221,6 +3221,11 @@ static int dwc3_msm_host_notifier(struct notifier_block *nb,
			pval.intval = 0;
			power_supply_set_property(mdwc->usb_psy,
					POWER_SUPPLY_PROP_BOOST_CURRENT, &pval);

			/* set rate back to default core clk rate */
			clk_set_rate(mdwc->core_clk, mdwc->core_clk_rate);
			dev_dbg(mdwc->dev, "set core clk rate %ld\n",
				mdwc->core_clk_rate);
			mdwc->max_rh_port_speed = USB_SPEED_UNKNOWN;
		}
	}