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

Commit 26b053be authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: ehci-hcd: Fix ehci shutdown unclocked register access



ehci shutdown callback can access registers with the clocks
turned off if the USB controller is in low power mode. Check
HCD_FLAG_HW_ACCESSIBLE flag before accessing any register.

Change-Id: Iafc9a5057aa196131b3aa7a2f659b9f8f052ec7f
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent c287f849
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -377,6 +377,9 @@ static void ehci_shutdown(struct usb_hcd *hcd)
	if (!ehci->sbrn)
		return;

	if (!HCD_HW_ACCESSIBLE(hcd))
		return;

	spin_lock_irq(&ehci->lock);
	ehci->shutdown = true;
	ehci->rh_state = EHCI_RH_STOPPING;