Linux USB
 help / color / mirror / Atom feed
From: Dinh Nguyen <dinguyen@kernel.org>
To: Minas.Harutyunyan@synopsys.com
Cc: dinguyen@kernel.org, Arthur.Petrosyan@synopsys.com,
	gregkh@linuxfoundation.org, linux-usb@vger.kernel.org
Subject: [PATCH] usb: dwc2: do not gate off the hardware if it does not support clock gating
Date: Mon,  3 Jan 2022 20:22:38 -0600	[thread overview]
Message-ID: <20220104022238.725195-1-dinguyen@kernel.org> (raw)

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


             reply	other threads:[~2022-01-04  2:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04  2:22 Dinh Nguyen [this message]
2022-01-04  7:31 ` [PATCH] usb: dwc2: do not gate off the hardware if it does not support clock gating Minas Harutyunyan
2022-01-04  9:39 ` Sergey Shtylyov
2022-01-04 13:56   ` Dinh Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220104022238.725195-1-dinguyen@kernel.org \
    --to=dinguyen@kernel.org \
    --cc=Arthur.Petrosyan@synopsys.com \
    --cc=Minas.Harutyunyan@synopsys.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox