WSL2-Linux-Kernel/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
..
Kconfig scsi: ufs: Fix 'unmet direct dependencies' config warning 2020-09-09 22:26:29 -04:00
Makefile
cdns-pltfrm.c
tc-dwc-g210-pci.c
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ti-j721e-ufs.c
ufs-exynos.c scsi: ufs: ufs-exynos: Use devm_platform_ioremap_resource_byname() 2020-09-29 22:52:43 -04:00
ufs-exynos.h
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
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
ufs_bsg.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
ufs_bsg.h
ufs_quirks.h
ufshcd-crypto.c scsi: ufs: Fix missing brace warning for old compilers 2020-10-02 19:11:55 -04:00
ufshcd-crypto.h
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
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