All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: alim.akhtar@samsung.com, avri.altman@wdc.com, robh+dt@kernel.org,
	krzk+dt@kernel.org
Cc: jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Subject: [PATCH v3 3/7] ufs: add UFSHCD_QUIRK_HIBERN_FASTAUTO
Date: Tue, 19 Apr 2022 21:03:12 +0900	[thread overview]
Message-ID: <20220419120316.209151-4-yoshihiro.shimoda.uh@renesas.com> (raw)
In-Reply-To: <20220419120316.209151-1-yoshihiro.shimoda.uh@renesas.com>

Add UFSHCD_QUIRK_HIBERN_FASTAUTO for a broken host controller of
the auto-hibernate capability but it's FASTAUTO only.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/scsi/ufs/ufshcd.c | 9 +++++++--
 drivers/scsi/ufs/ufshcd.h | 6 ++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index a7bb3945c7c6..adc059a86e1e 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4247,8 +4247,13 @@ static int ufshcd_get_max_pwr_mode(struct ufs_hba *hba)
 	if (hba->max_pwr_info.is_valid)
 		return 0;
 
-	pwr_info->pwr_tx = FAST_MODE;
-	pwr_info->pwr_rx = FAST_MODE;
+	if (hba->quirks & UFSHCD_QUIRK_HIBERN_FASTAUTO) {
+		pwr_info->pwr_tx = FASTAUTO_MODE;
+		pwr_info->pwr_rx = FASTAUTO_MODE;
+	} else {
+		pwr_info->pwr_tx = FAST_MODE;
+		pwr_info->pwr_rx = FAST_MODE;
+	}
 	pwr_info->hs_rate = PA_HS_MODE_B;
 
 	/* Get the connected lane count */
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 1745144eb904..d14cc48226ce 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -608,6 +608,12 @@ enum ufshcd_quirks {
 	 * 64-bit addressing supported capability but it doesn't work.
 	 */
 	UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS		= 1 << 17,
+
+	/*
+	 * This quirk needs to be enabled if the host controller has
+	 * auto-hibernate capability but it's FASTAUTO only.
+	 */
+	UFSHCD_QUIRK_HIBERN_FASTAUTO			= 1 << 18,
 };
 
 enum ufshcd_caps {
-- 
2.25.1


  parent reply	other threads:[~2022-04-19 12:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 12:03 [PATCH v3 0/7] treewide: scsi: ufs: Add support for Renesas R-Car UFS controller Yoshihiro Shimoda
2022-04-19 12:03 ` [PATCH v3 1/7] dt-bindings: ufs: Document Renesas R-Car UFS host controller Yoshihiro Shimoda
2022-04-19 12:03 ` [PATCH v3 2/7] ufs: add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS Yoshihiro Shimoda
2022-04-19 12:03 ` Yoshihiro Shimoda [this message]
2022-04-19 12:03 ` [PATCH v3 4/7] scsi: ufs-renesas: Add support for Renesas R-Car UFS controller Yoshihiro Shimoda
2022-04-19 23:40   ` kernel test robot
2022-04-20  1:56     ` Yoshihiro Shimoda
2022-04-20  1:56     ` Yoshihiro Shimoda
2022-04-19 12:03 ` [PATCH v3 5/7] scsi: MAINTAINERS: Add maintainer for Renesas UFS driver Yoshihiro Shimoda
2022-04-19 12:03 ` [PATCH v3 6/7] arm64: dts: renesas: r8a779f0: Add UFS node Yoshihiro Shimoda
2022-04-19 12:03 ` [PATCH v3 7/7] arm64: dts: renesas: r8a779f0: spider-cpu: Enable UFS device Yoshihiro Shimoda

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=20220419120316.209151-4-yoshihiro.shimoda.uh@renesas.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=robh+dt@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 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.