mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ten Gao <gaoyankaigeren@gmail.com>
To: Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	Bart Van Assche <bvanassche@acm.org>,
	"James E . J . Bottomley" <jejb@linux.ibm.com>,
	Bean Huo <beanhuo@micron.com>,
	Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] ufs: core: Disable auto h8 before ssu
Date: Tue, 11 Oct 2022 10:16:53 +0800	[thread overview]
Message-ID: <20221011021653.27277-1-gaoyankaigeren@gmail.com> (raw)

From: Ten Gao <ten.gao@unisoc.com>

Ensure auto h8 will not hit dme h8,and there won't be two h8 in a row
after ssu.

Signed-off-by: Ten Gao <ten.gao@unisoc.com>
---
 drivers/ufs/core/ufshcd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index a202d7d5240d..42f93648d796 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4256,6 +4256,14 @@ void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit)
 }
 EXPORT_SYMBOL_GPL(ufshcd_auto_hibern8_update);
 
+void ufshcd_auto_hibern8_disable(struct ufs_hba *hba)
+{
+	if (!ufshcd_is_auto_hibern8_supported(hba))
+		return;
+
+	ufshcd_writel(hba, 0, REG_AUTO_HIBERNATE_IDLE_TIMER);
+}
+
 void ufshcd_auto_hibern8_enable(struct ufs_hba *hba)
 {
 	if (!ufshcd_is_auto_hibern8_supported(hba))
@@ -9036,6 +9044,8 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
 	if (ret)
 		goto enable_scaling;
 
+	ufshcd_auto_hibern8_disable(hba);
+
 	if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
 		if (pm_op != UFS_RUNTIME_PM)
 			/* ensure that bkops is disabled */
-- 
2.17.1


             reply	other threads:[~2022-10-11  2:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-11  2:16 Ten Gao [this message]
2022-10-11  3:39 ` kernel test robot
2022-10-11  7:07 ` Avri Altman
2022-10-11 11:53   ` 高严凯
2022-10-12  6:28     ` Avri Altman
2022-10-12  8:12       ` Avri Altman
2022-10-12  8:49         ` 高严凯
2022-10-12 14:25     ` Bean Huo
2022-10-14  2:44       ` 高严凯
2022-10-14  5:48         ` Bean Huo
2022-10-14 10:15           ` 高严凯
2022-10-20  5:15             ` 高严凯
2022-10-20 17:47               ` Bart Van Assche
2022-10-11  9:59 ` kernel test robot

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=20221011021653.27277-1-gaoyankaigeren@gmail.com \
    --to=gaoyankaigeren@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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

all inboxes | Powered by JetHome®