This prevents the error handler racing with scsi_unjam_host() which can submit requests directly to ->queuecommand() i.e. ufshcd_queuecommand(). It also could pave the way in the future for removing the need for host_sem. Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx> --- drivers/scsi/ufs/ufshcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3c11a35ecba6..439937ce693c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -5984,12 +5984,11 @@ static void ufshcd_err_handling_prepare(struct ufs_hba *hba) ufshcd_scsi_block_requests(hba); /* Drain ufshcd_queuecommand() */ ufshcd_down_write(hba); - ufshcd_up_write(hba); - cancel_work_sync(&hba->eeh_work); } static void ufshcd_err_handling_unprepare(struct ufs_hba *hba) { + ufshcd_up_write(hba); ufshcd_scsi_unblock_requests(hba); ufshcd_release(hba); if (ufshcd_is_clkscaling_supported(hba)) -- 2.25.1