From 3442ca89f2d3a08d0106b4cd78fdf97b7de98211 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Fri, 20 Nov 2020 20:48:10 -0800 Subject: [PATCH] UPSTREAM: scsi: ufs: Adjust logic in common ADAPT helper 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. Link: https://lore.kernel.org/r/20201121044810.507288-1-bjorn.andersson@linaro.org Fixes: fc85a74e28fe ("scsi: ufs: Refactor ADAPT configuration function") Reviewed-by: Can Guo Reviewed-by: Stanley Chu Signed-off-by: Bjorn Andersson Signed-off-by: Martin K. Petersen (cherry picked from commit 66df79ccbc2f617a2bbaa7108a2b50a6869de5d4) Bug: 204438323 Change-Id: Ibb643d41f8d27a6982fac7ce301b6debdc72dbd2 Signed-off-by: Bart Van Assche --- 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 4180994433aa..6f9db81da7da 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3763,7 +3763,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),