Commit 34146c68 authored by Dinh Nguyen's avatar Dinh Nguyen Committed by Greg Kroah-Hartman
Browse files

usb: dwc2: do not gate off the hardware if it does not support clock gating



We should not be clearing the HCD_FLAG_HW_ACCESSIBLE bit if the hardware
does not support clock gating.

Fixes: 50fb0c12 ("usb: dwc2: Add clock gating entering flow by system suspend")
Acked-by: default avatarMinas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Signed-off-by: default avatarDinh Nguyen <dinguyen@kernel.org>
Link: https://lore.kernel.org/r/20220104135922.734776-1-dinguyen@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b52fe2db
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4399,11 +4399,12 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd)
		 * If not hibernation nor partial power down are supported,
		 * clock gating is used to save power.
		 */
		if (!hsotg->params.no_clock_gating)
		if (!hsotg->params.no_clock_gating) {
			dwc2_host_enter_clock_gating(hsotg);

			/* After entering suspend, hardware is not accessible */
			clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
		}
		break;
	default:
		goto skip_power_saving;