linux-stable/drivers/scsi/ufs
Stanley Chu e92643db51 scsi: ufs: Fix race between shutdown and runtime resume flow
If UFS host device is in runtime-suspended state while UFS shutdown
callback is invoked, UFS device shall be resumed for register
accesses. Currently only UFS local runtime resume function will be invoked
to wake up the host.  This is not enough because if someone triggers
runtime resume from block layer, then race may happen between shutdown and
runtime resume flow, and finally lead to unlocked register access.

To fix this, in ufshcd_shutdown(), use pm_runtime_get_sync() instead of
resuming UFS device by ufshcd_runtime_resume() "internally" to let runtime
PM framework manage the whole resume flow.

Link: https://lore.kernel.org/r/20201119062916.12931-1-stanley.chu@mediatek.com
Fixes: 57d104c153 ("ufs: add UFS power management support")
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-11-19 22:18:36 -05:00
..
cdns-pltfrm.c
Kconfig scsi: ufs: Fix 'unmet direct dependencies' config warning 2020-09-09 22:26:29 -04:00
Makefile scsi: ufs-qcom: Add Inline Crypto Engine support 2020-07-24 22:09:54 -04:00
tc-dwc-g210-pci.c
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ti-j721e-ufs.c scsi: ufs: ti-j721e-ufs: Fix error return in ti_j721e_ufs_probe() 2020-08-17 21:48:45 -04:00
ufs-exynos.c scsi: ufs: ufs-exynos: Use devm_platform_ioremap_resource_byname() 2020-09-29 22:52:43 -04:00
ufs-exynos.h scsi: ufs: ufs-exynos: Add UFS host support for Exynos SoCs 2020-06-15 14:04:10 -04:00
ufs-hisi.c
ufs-hisi.h
ufs-mediatek.c scsi: ufs-mediatek: Support performance mode for inline encryption engine 2020-09-22 20:37:02 -04:00
ufs-mediatek.h scsi: ufs-mediatek: Support performance mode for inline encryption engine 2020-09-22 20:37:02 -04:00
ufs-qcom-ice.c scsi: ufs-qcom: Add Inline Crypto Engine support 2020-07-24 22:09:54 -04:00
ufs-qcom.c scsi: ufs-qcom: Remove unused MSM bus scaling APIs 2020-08-20 21:41:51 -04:00
ufs-qcom.h scsi: ufs-qcom: Remove unused MSM bus scaling APIs 2020-08-20 21:41:51 -04:00
ufs-sysfs.c scsi: ufshcd: Allow specifying an Auto-Hibernate Timer value of zero 2020-09-08 21:26:15 -04:00
ufs-sysfs.h
ufs.h scsi: ufs: Add SPDX GPL-2.0 to replace GPL v2 boilerplate 2020-06-15 23:21:04 -04:00
ufs_bsg.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ufs_bsg.h
ufs_quirks.h scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM" 2020-07-30 21:10:29 -04:00
ufshcd-crypto.c scsi: ufs: Fix missing brace warning for old compilers 2020-10-02 19:11:55 -04:00
ufshcd-crypto.h scsi: ufs: Add inline encryption support to UFS 2020-07-08 01:23:32 -04:00
ufshcd-dwc.c
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs-pci: Add LTR support for Intel controllers 2020-09-15 16:11:47 -04:00
ufshcd-pltfrm.c scsi: ufs: Add SPDX GPL-2.0 to replace GPL v2 boilerplate 2020-06-15 23:21:04 -04:00
ufshcd-pltfrm.h
ufshcd.c scsi: ufs: Fix race between shutdown and runtime resume flow 2020-11-19 22:18:36 -05:00
ufshcd.h scsi: ufs: Try to save power mode change and UIC cmd completion timeout 2020-11-04 23:13:33 -05:00
ufshci-dwc.h
ufshci.h scsi: ufs: Handle LINERESET indication in err handler 2020-09-02 22:49:07 -04:00
unipro.h scsi: ufs: Handle LINERESET indication in err handler 2020-09-02 22:49:07 -04:00