[PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6

Nitin Rawat posted 3 patches 3 months ago
There is a newer version of this series
[PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Nitin Rawat 3 months ago
From: "Bao D. Nguyen" <quic_nguyenb@quicinc.com>

The MCQ feature and ESI are supported by all Qualcomm UFS controller
versions 6 and above.

Therefore, update the ESI vector mask in the UFS_MEM_CFG3 register
for platforms with major version number of 6 or higher.

Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
---
 drivers/ufs/host/ufs-qcom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 318dca7fe3d7..dfdc52333a96 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -2113,8 +2113,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 
 	retain_and_null_ptr(qi);
 
-	if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
-	    host->hw_ver.step == 0) {
+	if (host->hw_ver.major >= 6) {
 		ufshcd_rmwl(hba, ESI_VEC_MASK, FIELD_PREP(ESI_VEC_MASK, MAX_ESI_VEC - 1),
 			    REG_UFS_CFG3);
 	}
-- 
2.48.1
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Manivannan Sadhasivam 3 months ago
On Tue, Jul 08, 2025 at 02:32:58AM GMT, Nitin Rawat wrote:
> From: "Bao D. Nguyen" <quic_nguyenb@quicinc.com>

Nit: Please use consistent subject prefix:

scsi: ufs: qcom:

Maybe we should get rid of 'scsi' prefix since the ufs code is now moved
outside of drivers/scsi/. Bart?

- Mani

> 
> The MCQ feature and ESI are supported by all Qualcomm UFS controller
> versions 6 and above.
> 
> Therefore, update the ESI vector mask in the UFS_MEM_CFG3 register
> for platforms with major version number of 6 or higher.
> 
> Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> ---
>  drivers/ufs/host/ufs-qcom.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 318dca7fe3d7..dfdc52333a96 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -2113,8 +2113,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>  
>  	retain_and_null_ptr(qi);
>  
> -	if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
> -	    host->hw_ver.step == 0) {
> +	if (host->hw_ver.major >= 6) {
>  		ufshcd_rmwl(hba, ESI_VEC_MASK, FIELD_PREP(ESI_VEC_MASK, MAX_ESI_VEC - 1),
>  			    REG_UFS_CFG3);
>  	}
> -- 
> 2.48.1
> 

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Bart Van Assche 3 months ago
On 7/8/25 12:53 AM, Manivannan Sadhasivam wrote:
> On Tue, Jul 08, 2025 at 02:32:58AM GMT, Nitin Rawat wrote:
>> From: "Bao D. Nguyen" <quic_nguyenb@quicinc.com>
> 
> Nit: Please use consistent subject prefix:
> 
> scsi: ufs: qcom:
> 
> Maybe we should get rid of 'scsi' prefix since the ufs code is now moved
> outside of drivers/scsi/. Bart?
Dropping the "scsi:" prefix sounds good to me because this prefix makes
patch subject lines a bit long.

Thanks,

Bart.
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Martin K. Petersen 2 months, 3 weeks ago
Bart,

>> Maybe we should get rid of 'scsi' prefix since the ufs code is now
>> moved outside of drivers/scsi/. Bart?

> Dropping the "scsi:" prefix sounds good to me because this prefix makes
> patch subject lines a bit long.

I have attempting separating SCSI and UFS a couple of times in the past.
However, there always seemed to be at least one SCSI core change
dependency per cycle which prevented that from happening.

I don't think we have had any for a while so I'll try to do two separate
trees for 6.18.

-- 
Martin K. Petersen
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Bart Van Assche 2 months, 3 weeks ago
On 7/14/25 10:25 AM, Martin K. Petersen wrote:
>>> Maybe we should get rid of 'scsi' prefix since the ufs code is now
>>> moved outside of drivers/scsi/. Bart?
> 
>> Dropping the "scsi:" prefix sounds good to me because this prefix makes
>> patch subject lines a bit long.
> 
> I have attempting separating SCSI and UFS a couple of times in the past.
> However, there always seemed to be at least one SCSI core change
> dependency per cycle which prevented that from happening.
> 
> I don't think we have had any for a while so I'll try to do two separate
> trees for 6.18.

Hi Martin,

Thanks for the feedback, but please keep in mind that I plan to repost
this patch series soon, a series that includes SCSI core and UFS driver
changes: "[PATCH 00/24] Optimize the hot path in the UFS driver"
(https://lore.kernel.org/linux-scsi/20250403211937.2225615-1-bvanassche@acm.org/). 
For the future, I expect such patch changes to be
the exception rather than the norm.

Thanks,

Bart.
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Martin K. Petersen 2 months, 3 weeks ago
Bart,

> Thanks for the feedback, but please keep in mind that I plan to repost
> this patch series soon, a series that includes SCSI core and UFS
> driver changes: "[PATCH 00/24] Optimize the hot path in the UFS
> driver"
> (https://lore.kernel.org/linux-scsi/20250403211937.2225615-1-bvanassche@acm.org/).
> For the future, I expect such patch changes to be the exception rather
> than the norm.

OK, that's fine.

-- 
Martin K. Petersen
Re: [PATCH V2 1/3] scsi: ufs: ufs-qcom: Update esi_vec_mask for HW major version >= 6
Posted by Manivannan Sadhasivam 3 months ago
On Tue, Jul 08, 2025 at 02:32:58AM GMT, Nitin Rawat wrote:
> From: "Bao D. Nguyen" <quic_nguyenb@quicinc.com>
> 
> The MCQ feature and ESI are supported by all Qualcomm UFS controller
> versions 6 and above.
> 
> Therefore, update the ESI vector mask in the UFS_MEM_CFG3 register
> for platforms with major version number of 6 or higher.
> 
> Signed-off-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>
> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/ufs/host/ufs-qcom.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 318dca7fe3d7..dfdc52333a96 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -2113,8 +2113,7 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>  
>  	retain_and_null_ptr(qi);
>  
> -	if (host->hw_ver.major == 6 && host->hw_ver.minor == 0 &&
> -	    host->hw_ver.step == 0) {
> +	if (host->hw_ver.major >= 6) {
>  		ufshcd_rmwl(hba, ESI_VEC_MASK, FIELD_PREP(ESI_VEC_MASK, MAX_ESI_VEC - 1),
>  			    REG_UFS_CFG3);
>  	}
> -- 
> 2.48.1
> 

-- 
மணிவண்ணன் சதாசிவம்