Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4
       [not found] <1581485910-8307-1-git-send-email-cang@codeaurora.org>
@ 2020-02-12  5:38 ` Can Guo
  2020-02-12 12:26   ` Avri Altman
                     ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Can Guo @ 2020-02-12  5:38 UTC (permalink / raw)
  To: asutoshd, nguyenb, hongwus, rnayak, linux-scsi, kernel-team,
	saravanak, salyzyn, cang
  Cc: Andy Gross, Bjorn Andersson, Alim Akhtar, Avri Altman,
	James E.J. Bottomley, Martin K. Petersen, Greg Kroah-Hartman,
	Pedro Sousa, Thomas Gleixner, linux-arm-msm, linux-kernel

ADAPT is added specifically for HS Gear4 mode only, select INITIAL ADAPT
before do power mode change to G4 and select NO ADAPT before switch to
non-G4 modes.

Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/ufs/ufs-qcom.c | 14 ++++++++++++++
 drivers/scsi/ufs/unipro.h   |  7 +++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index d593523..6a905bb 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -942,6 +942,20 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
 		if (!ufshcd_is_hs_mode(&hba->pwr_info) &&
 			ufshcd_is_hs_mode(dev_req_params))
 			ufs_qcom_dev_ref_clk_ctrl(host, true);
+
+		if (host->hw_ver.major >= 0x4) {
+			if (dev_req_params->gear_tx == UFS_HS_G4) {
+				/* INITIAL ADAPT */
+				ufshcd_dme_set(hba,
+					       UIC_ARG_MIB(PA_TXHSADAPTTYPE),
+					       PA_INITIAL_ADAPT);
+			} else {
+				/* NO ADAPT */
+				ufshcd_dme_set(hba,
+					       UIC_ARG_MIB(PA_TXHSADAPTTYPE),
+					       PA_NO_ADAPT);
+			}
+		}
 		break;
 	case POST_CHANGE:
 		if (ufs_qcom_cfg_timers(hba, dev_req_params->gear_rx,
diff --git a/drivers/scsi/ufs/unipro.h b/drivers/scsi/ufs/unipro.h
index 3dc4d8b..766d551 100644
--- a/drivers/scsi/ufs/unipro.h
+++ b/drivers/scsi/ufs/unipro.h
@@ -146,6 +146,12 @@
 #define PA_SLEEPNOCONFIGTIME	0x15A2
 #define PA_STALLNOCONFIGTIME	0x15A3
 #define PA_SAVECONFIGTIME	0x15A4
+#define PA_TXHSADAPTTYPE       0x15D4
+
+/* Adpat type for PA_TXHSADAPTTYPE attribute */
+#define PA_REFRESH_ADAPT       0x00
+#define PA_INITIAL_ADAPT       0x01
+#define PA_NO_ADAPT            0x03
 
 #define PA_TACTIVATE_TIME_UNIT_US	10
 #define PA_HIBERN8_TIME_UNIT_US		100
@@ -203,6 +209,7 @@ enum ufs_hs_gear_tag {
 	UFS_HS_G1,		/* HS Gear 1 (default for reset) */
 	UFS_HS_G2,		/* HS Gear 2 */
 	UFS_HS_G3,		/* HS Gear 3 */
+	UFS_HS_G4,		/* HS Gear 4 */
 };
 
 enum ufs_unipro_ver {
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

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

* RE: [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4
  2020-02-12  5:38 ` [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4 Can Guo
@ 2020-02-12 12:26   ` Avri Altman
  2020-02-12 17:04   ` asutoshd
  2020-02-13  0:36   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Avri Altman @ 2020-02-12 12:26 UTC (permalink / raw)
  To: Can Guo, asutoshd, nguyenb, hongwus, rnayak, linux-scsi,
	kernel-team, saravanak, salyzyn
  Cc: Andy Gross, Bjorn Andersson, Alim Akhtar, James E.J. Bottomley,
	Martin K. Petersen, Greg Kroah-Hartman, Pedro Sousa,
	Thomas Gleixner, open list:ARM/QUALCOMM SUPPORT, open list

> 
> ADAPT is added specifically for HS Gear4 mode only, select INITIAL ADAPT
> before do power mode change to G4 and select NO ADAPT before switch to
> non-G4 modes.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

Thanks,
Avri


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

* Re: [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4
  2020-02-12  5:38 ` [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4 Can Guo
  2020-02-12 12:26   ` Avri Altman
@ 2020-02-12 17:04   ` asutoshd
  2020-02-13  0:36   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: asutoshd @ 2020-02-12 17:04 UTC (permalink / raw)
  To: Can Guo
  Cc: nguyenb, hongwus, rnayak, linux-scsi, kernel-team, saravanak,
	salyzyn, Andy Gross, Bjorn Andersson, Alim Akhtar, Avri Altman,
	James E.J. Bottomley, Martin K. Petersen, Greg Kroah-Hartman,
	Pedro Sousa, Thomas Gleixner, linux-arm-msm, linux-kernel,
	linux-scsi-owner

On 2020-02-11 21:38, Can Guo wrote:
> ADAPT is added specifically for HS Gear4 mode only, select INITIAL 
> ADAPT
> before do power mode change to G4 and select NO ADAPT before switch to
> non-G4 modes.
> 
> Signed-off-by: Can Guo <cang@codeaurora.org>
> ---

Reviewed-by:  Asutosh Das <asutoshd@codeaurora.org>

>  drivers/scsi/ufs/ufs-qcom.c | 14 ++++++++++++++
>  drivers/scsi/ufs/unipro.h   |  7 +++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index d593523..6a905bb 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -942,6 +942,20 @@ static int ufs_qcom_pwr_change_notify(struct 
> ufs_hba *hba,
>  		if (!ufshcd_is_hs_mode(&hba->pwr_info) &&
>  			ufshcd_is_hs_mode(dev_req_params))
>  			ufs_qcom_dev_ref_clk_ctrl(host, true);
> +
> +		if (host->hw_ver.major >= 0x4) {
> +			if (dev_req_params->gear_tx == UFS_HS_G4) {
> +				/* INITIAL ADAPT */
> +				ufshcd_dme_set(hba,
> +					       UIC_ARG_MIB(PA_TXHSADAPTTYPE),
> +					       PA_INITIAL_ADAPT);
> +			} else {
> +				/* NO ADAPT */
> +				ufshcd_dme_set(hba,
> +					       UIC_ARG_MIB(PA_TXHSADAPTTYPE),
> +					       PA_NO_ADAPT);
> +			}
> +		}
>  		break;
>  	case POST_CHANGE:
>  		if (ufs_qcom_cfg_timers(hba, dev_req_params->gear_rx,
> diff --git a/drivers/scsi/ufs/unipro.h b/drivers/scsi/ufs/unipro.h
> index 3dc4d8b..766d551 100644
> --- a/drivers/scsi/ufs/unipro.h
> +++ b/drivers/scsi/ufs/unipro.h
> @@ -146,6 +146,12 @@
>  #define PA_SLEEPNOCONFIGTIME	0x15A2
>  #define PA_STALLNOCONFIGTIME	0x15A3
>  #define PA_SAVECONFIGTIME	0x15A4
> +#define PA_TXHSADAPTTYPE       0x15D4
> +
> +/* Adpat type for PA_TXHSADAPTTYPE attribute */
> +#define PA_REFRESH_ADAPT       0x00
> +#define PA_INITIAL_ADAPT       0x01
> +#define PA_NO_ADAPT            0x03
> 
>  #define PA_TACTIVATE_TIME_UNIT_US	10
>  #define PA_HIBERN8_TIME_UNIT_US		100
> @@ -203,6 +209,7 @@ enum ufs_hs_gear_tag {
>  	UFS_HS_G1,		/* HS Gear 1 (default for reset) */
>  	UFS_HS_G2,		/* HS Gear 2 */
>  	UFS_HS_G3,		/* HS Gear 3 */
> +	UFS_HS_G4,		/* HS Gear 4 */
>  };
> 
>  enum ufs_unipro_ver {

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

* Re: [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4
  2020-02-12  5:38 ` [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4 Can Guo
  2020-02-12 12:26   ` Avri Altman
  2020-02-12 17:04   ` asutoshd
@ 2020-02-13  0:36   ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2020-02-13  0:36 UTC (permalink / raw)
  To: Can Guo
  Cc: asutoshd, nguyenb, hongwus, rnayak, linux-scsi, kernel-team,
	saravanak, salyzyn, Andy Gross, Bjorn Andersson, Alim Akhtar,
	Avri Altman, James E.J. Bottomley, Martin K. Petersen,
	Greg Kroah-Hartman, Pedro Sousa, Thomas Gleixner, linux-arm-msm,
	linux-kernel


Can,

> ADAPT is added specifically for HS Gear4 mode only, select INITIAL
> ADAPT before do power mode change to G4 and select NO ADAPT before
> switch to non-G4 modes.

Applied to 5.7/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1581485910-8307-1-git-send-email-cang@codeaurora.org>
2020-02-12  5:38 ` [PATCH v1 2/2] scsi: ufs: Select INITIAL ADAPT type for HS Gear4 Can Guo
2020-02-12 12:26   ` Avri Altman
2020-02-12 17:04   ` asutoshd
2020-02-13  0:36   ` Martin K. Petersen

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git