diff options
author | Kiwoong Kim <kwmad.kim@samsung.com> | 2020-12-19 15:40:39 +0900 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-01-05 22:26:15 -0500 |
commit | 6948a96a0d69b7e8203758f44849ce4ab06ff788 (patch) | |
tree | 1eaee0a0e65b33a6f59fe33be13a873ff5279910 /drivers/scsi/ufs/ufshcd.c | |
parent | 21acf4601cc63cf564c6fc1a74d81b191313c929 (diff) |
scsi: ufs: Relocate flush of exceptional event
The current flush location does not guarantee disabling BKOPS for the case
of requesting device power off.
1) The exceptional event handler is queued
2) ufs suspend starts with a request of device power off
3) BKOPS is disabled in ufs suspend
4) The queued work for the handler is done and BKOPS is re-enabled
Relocate the flush statement to ensure BKOPS remain disabled.
Link: https://lore.kernel.org/r/1608360039-16390-1-git-send-email-kwmad.kim@samsung.com
Reviewed-by: Can Guo <cang@codeaurora.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 04ab6f2ccac6..00ee8cabf8e0 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8696,6 +8696,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) ufshcd_wb_need_flush(hba)); } + flush_work(&hba->eeh_work); + if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) { if (!ufshcd_is_runtime_pm(pm_op)) /* ensure that bkops is disabled */ @@ -8708,8 +8710,6 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) } } - flush_work(&hba->eeh_work); - /* * In the case of DeepSleep, the device is expected to remain powered * with the link off, so do not check for bkops. |