linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: Adjust logic in common ADAPT helper
@ 2020-11-21  4:48 Bjorn Andersson
  2020-11-21 16:23 ` Stanley Chu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Bjorn Andersson @ 2020-11-21  4:48 UTC (permalink / raw)
  To: Alim Akhtar, Avri Altman, James E.J. Bottomley,
	Martin K. Petersen, Stanley Chu, Can Guo, Asutosh Das, Bean Huo
  Cc: linux-scsi, linux-kernel, linux-arm-msm

The introduction of ufshcd_dme_configure_adapt() refactored out
duplication from the Mediatek and Qualcomm drivers.

Both these implementations had the logic of:
    gear_tx == UFS_HS_G4 => PA_INITIAL_ADAPT
    gear_tx != UFS_HS_G4 => PA_NO_ADAPT

but now both implementations pass PA_INITIAL_ADAPT as "adapt_val" and if
gear_tx is not UFS_HS_G4 that is replaced with PA_INITIAL_ADAPT. In
other words, it's PA_INITIAL_ADAPT in both above cases.

The result is that e.g. Qualcomm SM8150 has no longer functional UFS, so
adjust the logic to match the previous implementation.

Fixes: fc85a74e28fe ("scsi: ufs: Refactor ADAPT configuration function")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
 drivers/scsi/ufs/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 52e077aa3efe..13281c74cb4f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -3618,7 +3618,7 @@ int ufshcd_dme_configure_adapt(struct ufs_hba *hba,
 	int ret;
 
 	if (agreed_gear != UFS_HS_G4)
-		adapt_val = PA_INITIAL_ADAPT;
+		adapt_val = PA_NO_ADAPT;
 
 	ret = ufshcd_dme_set(hba,
 			     UIC_ARG_MIB(PA_TXHSADAPTTYPE),
-- 
2.28.0


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

* Re: [PATCH] scsi: ufs: Adjust logic in common ADAPT helper
  2020-11-21  4:48 [PATCH] scsi: ufs: Adjust logic in common ADAPT helper Bjorn Andersson
@ 2020-11-21 16:23 ` Stanley Chu
  2020-11-23  1:25 ` Can Guo
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stanley Chu @ 2020-11-21 16:23 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Alim Akhtar, Avri Altman, James E.J. Bottomley,
	Martin K. Petersen, Can Guo, Asutosh Das, Bean Huo, linux-scsi,
	linux-kernel, linux-arm-msm

On Fri, 2020-11-20 at 20:48 -0800, Bjorn Andersson wrote:
> The introduction of ufshcd_dme_configure_adapt() refactored out
> duplication from the Mediatek and Qualcomm drivers.
> 
> Both these implementations had the logic of:
>     gear_tx == UFS_HS_G4 => PA_INITIAL_ADAPT
>     gear_tx != UFS_HS_G4 => PA_NO_ADAPT
> 
> but now both implementations pass PA_INITIAL_ADAPT as "adapt_val" and if
> gear_tx is not UFS_HS_G4 that is replaced with PA_INITIAL_ADAPT. In
> other words, it's PA_INITIAL_ADAPT in both above cases.
> 
> The result is that e.g. Qualcomm SM8150 has no longer functional UFS, so
> adjust the logic to match the previous implementation.
> 
> Fixes: fc85a74e28fe ("scsi: ufs: Refactor ADAPT configuration function")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Thanks for the fix.

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>

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

* Re: [PATCH] scsi: ufs: Adjust logic in common ADAPT helper
  2020-11-21  4:48 [PATCH] scsi: ufs: Adjust logic in common ADAPT helper Bjorn Andersson
  2020-11-21 16:23 ` Stanley Chu
@ 2020-11-23  1:25 ` Can Guo
  2020-11-24  3:08 ` Martin K. Petersen
  2020-12-01  5:04 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Can Guo @ 2020-11-23  1:25 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Alim Akhtar, Avri Altman, James E.J. Bottomley,
	Martin K. Petersen, Stanley Chu, Asutosh Das, Bean Huo,
	linux-scsi, linux-kernel, linux-arm-msm

On 2020-11-21 12:48, Bjorn Andersson wrote:
> The introduction of ufshcd_dme_configure_adapt() refactored out
> duplication from the Mediatek and Qualcomm drivers.
> 
> Both these implementations had the logic of:
>     gear_tx == UFS_HS_G4 => PA_INITIAL_ADAPT
>     gear_tx != UFS_HS_G4 => PA_NO_ADAPT
> 
> but now both implementations pass PA_INITIAL_ADAPT as "adapt_val" and 
> if
> gear_tx is not UFS_HS_G4 that is replaced with PA_INITIAL_ADAPT. In
> other words, it's PA_INITIAL_ADAPT in both above cases.
> 
> The result is that e.g. Qualcomm SM8150 has no longer functional UFS, 
> so
> adjust the logic to match the previous implementation.
> 
> Fixes: fc85a74e28fe ("scsi: ufs: Refactor ADAPT configuration 
> function")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Reviewed-by: Can Guo <cang@codeaurora.org>

> ---
>  drivers/scsi/ufs/ufshcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 52e077aa3efe..13281c74cb4f 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -3618,7 +3618,7 @@ int ufshcd_dme_configure_adapt(struct ufs_hba 
> *hba,
>  	int ret;
> 
>  	if (agreed_gear != UFS_HS_G4)
> -		adapt_val = PA_INITIAL_ADAPT;
> +		adapt_val = PA_NO_ADAPT;
> 
>  	ret = ufshcd_dme_set(hba,
>  			     UIC_ARG_MIB(PA_TXHSADAPTTYPE),

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

* Re: [PATCH] scsi: ufs: Adjust logic in common ADAPT helper
  2020-11-21  4:48 [PATCH] scsi: ufs: Adjust logic in common ADAPT helper Bjorn Andersson
  2020-11-21 16:23 ` Stanley Chu
  2020-11-23  1:25 ` Can Guo
@ 2020-11-24  3:08 ` Martin K. Petersen
  2020-12-01  5:04 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-11-24  3:08 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Alim Akhtar, Avri Altman, James E.J. Bottomley,
	Martin K. Petersen, Stanley Chu, Can Guo, Asutosh Das, Bean Huo,
	linux-scsi, linux-kernel, linux-arm-msm


Bjorn,

> The introduction of ufshcd_dme_configure_adapt() refactored out
> duplication from the Mediatek and Qualcomm drivers.

Applied to 5.11/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: ufs: Adjust logic in common ADAPT helper
  2020-11-21  4:48 [PATCH] scsi: ufs: Adjust logic in common ADAPT helper Bjorn Andersson
                   ` (2 preceding siblings ...)
  2020-11-24  3:08 ` Martin K. Petersen
@ 2020-12-01  5:04 ` Martin K. Petersen
  3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2020-12-01  5:04 UTC (permalink / raw)
  To: James E.J. Bottomley, Asutosh Das, Alim Akhtar, Bjorn Andersson,
	Avri Altman, Can Guo, Bean Huo, Stanley Chu
  Cc: Martin K . Petersen, linux-scsi, linux-kernel, linux-arm-msm

On Fri, 20 Nov 2020 20:48:10 -0800, Bjorn Andersson wrote:

> The introduction of ufshcd_dme_configure_adapt() refactored out
> duplication from the Mediatek and Qualcomm drivers.
> 
> Both these implementations had the logic of:
>     gear_tx == UFS_HS_G4 => PA_INITIAL_ADAPT
>     gear_tx != UFS_HS_G4 => PA_NO_ADAPT
> 
> [...]

Applied to 5.11/scsi-queue, thanks!

[1/1] scsi: ufs: Adjust logic in common ADAPT helper
      https://git.kernel.org/mkp/scsi/c/66df79ccbc2f

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2020-12-01  5:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-21  4:48 [PATCH] scsi: ufs: Adjust logic in common ADAPT helper Bjorn Andersson
2020-11-21 16:23 ` Stanley Chu
2020-11-23  1:25 ` Can Guo
2020-11-24  3:08 ` Martin K. Petersen
2020-12-01  5:04 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).