lkml.org 
[lkml]   [2021]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] scsi: ufs: add missing host_lock in setup_xfer_req
From
Date
On 6/30/21 5:51 PM, Jaegeuk Kim wrote:
> This patch adds a host_lock which existed before on ufshcd_vops_setup_xfer_req.
>
> Cc: Stanley Chu <stanley.chu@mediatek.com>
> Cc: Can Guo <cang@codeaurora.org>
> Cc: Bean Huo <beanhuo@micron.com>
> Cc: Bart Van Assche <bvanassche@acm.org>
> Cc: Asutosh Das <asutoshd@codeaurora.org>
> Fixes: a45f937110fa ("scsi: ufs: Optimize host lock on transfer requests send/compl paths")
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
> drivers/scsi/ufs/ufshcd.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
> index c98d540ac044..194755c9ddfe 100644
> --- a/drivers/scsi/ufs/ufshcd.h
> +++ b/drivers/scsi/ufs/ufshcd.h
> @@ -1229,8 +1229,13 @@ static inline int ufshcd_vops_pwr_change_notify(struct ufs_hba *hba,
> static inline void ufshcd_vops_setup_xfer_req(struct ufs_hba *hba, int tag,
> bool is_scsi_cmd)
> {
> - if (hba->vops && hba->vops->setup_xfer_req)
> - return hba->vops->setup_xfer_req(hba, tag, is_scsi_cmd);
> + if (hba->vops && hba->vops->setup_xfer_req) {
> + unsigned long flags;
> +
> + spin_lock_irqsave(hba->host->host_lock, flags);
> + hba->vops->setup_xfer_req(hba, tag, is_scsi_cmd);
> + spin_unlock_irqrestore(hba->host->host_lock, flags);
> + }
> }
>
> static inline void ufshcd_vops_setup_task_mgmt(struct ufs_hba *hba,

Can anyone help with reviewing this patch?

Thanks,

Bart.


\
 
 \ /
  Last update: 2021-07-13 21:07    [W:0.065 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site