All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc2: do not gate off the hardware if it does not support clock gating
@ 2022-01-04  2:22 Dinh Nguyen
  2022-01-04  7:31 ` Minas Harutyunyan
  2022-01-04  9:39 ` Sergey Shtylyov
  0 siblings, 2 replies; 4+ messages in thread
From: Dinh Nguyen @ 2022-01-04  2:22 UTC (permalink / raw)
  To: Minas.Harutyunyan; +Cc: dinguyen, Arthur.Petrosyan, gregkh, linux-usb

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

Fixes: 50fb0c128b6e ("usb: dwc2: Add clock gating entering flow by
system suspend")
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/usb/dwc2/hcd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 13c779a28e94..f63a27d11fac 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -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);
+			/* After entering suspend, hardware is not accessible */
+			clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
+		}
 		break;
 	default:
 		goto skip_power_saving;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-04 13:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04  2:22 [PATCH] usb: dwc2: do not gate off the hardware if it does not support clock gating Dinh Nguyen
2022-01-04  7:31 ` Minas Harutyunyan
2022-01-04  9:39 ` Sergey Shtylyov
2022-01-04 13:56   ` Dinh Nguyen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.