diff mbox series

[4/7] scsi: ufs: core: Fix ufshcd_exception_event_handler()

Message ID 20241016211154.2425403-5-bvanassche@acm.org (mailing list archive)
State New
Headers show
Series UFS driver fixes and cleanups | expand

Commit Message

Bart Van Assche Oct. 16, 2024, 9:11 p.m. UTC
Use blk_mq_quiesce_tagset() / blk_mq_unquiesce_tagset() instead of
scsi_block_requests() / scsi_unblock_requests() because the former wait
for ongoing SCSI command dispatching to finish while the latter do not.

Fixes: 2e3611e9546c ("scsi: ufs: fix exception event handling")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Avri Altman Oct. 18, 2024, 5:50 a.m. UTC | #1
> Use blk_mq_quiesce_tagset() / blk_mq_unquiesce_tagset() instead of
> scsi_block_requests() / scsi_unblock_requests() because the former wait for
> ongoing SCSI command dispatching to finish while the latter do not.
> 
> Fixes: 2e3611e9546c ("scsi: ufs: fix exception event handling")
I think that when Maya introduced the scsi_block_requests calls (2018),
the block tagset quiesce api wasn't available yet (2022).

Thanks,
Avri

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/ufs/core/ufshcd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
> 76884df580c3..ff1b0af74041 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6195,7 +6195,7 @@ static void ufshcd_exception_event_handler(struct
> work_struct *work)
>         u32 status = 0;
>         hba = container_of(work, struct ufs_hba, eeh_work);
> 
> -       ufshcd_scsi_block_requests(hba);
> +       blk_mq_quiesce_tagset(&hba->host->tag_set);
>         err = ufshcd_get_ee_status(hba, &status);
>         if (err) {
>                 dev_err(hba->dev, "%s: failed to get exception status %d\n", @@ -
> 6213,7 +6213,7 @@ static void ufshcd_exception_event_handler(struct
> work_struct *work)
> 
>         ufs_debugfs_exception_event(hba, status);
>  out:
> -       ufshcd_scsi_unblock_requests(hba);
> +       blk_mq_unquiesce_tagset(&hba->host->tag_set);
>  }
> 
>  /* Complete requests that have door-bell cleared */
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 76884df580c3..ff1b0af74041 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6195,7 +6195,7 @@  static void ufshcd_exception_event_handler(struct work_struct *work)
 	u32 status = 0;
 	hba = container_of(work, struct ufs_hba, eeh_work);
 
-	ufshcd_scsi_block_requests(hba);
+	blk_mq_quiesce_tagset(&hba->host->tag_set);
 	err = ufshcd_get_ee_status(hba, &status);
 	if (err) {
 		dev_err(hba->dev, "%s: failed to get exception status %d\n",
@@ -6213,7 +6213,7 @@  static void ufshcd_exception_event_handler(struct work_struct *work)
 
 	ufs_debugfs_exception_event(hba, status);
 out:
-	ufshcd_scsi_unblock_requests(hba);
+	blk_mq_unquiesce_tagset(&hba->host->tag_set);
 }
 
 /* Complete requests that have door-bell cleared */