1
0
Fork 0
alistair23-linux/drivers/scsi/ufs
Can Guo adad2bc9f3 scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE
[ Upstream commit 73cc291c27 ]

If someone plays with the UFS clk scaling devfreq governor through sysfs,
ufshcd_devfreq_scale may be called even when HBA is not runtime ACTIVE.
This can lead to unexpected error. We cannot just protect it by calling
pm_runtime_get_sync() because that may cause a race condition since HBA
runtime suspend ops need to suspend clk scaling. To fix this call
pm_runtime_get_noresume() and check HBA's runtime status. Only proceed if
HBA is runtime ACTIVE, otherwise just bail.

governor_store
 devfreq_performance_handler
  update_devfreq
   devfreq_set_target
    ufshcd_devfreq_target
     ufshcd_devfreq_scale

Link: https://lore.kernel.org/r/1600758548-28576-1-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-16 10:56:56 +01:00
..
Kconfig
Makefile
cdns-pltfrm.c scsi: ufs: Disable autohibern8 feature in Cadence UFS 2019-12-21 11:05:03 +01:00
tc-dwc-g210-pci.c
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ufs-hisi.c scsi: ufs-hisi: use devm_platform_ioremap_resource() to simplify code 2019-09-07 16:43:05 -04:00
ufs-hisi.h
ufs-mediatek.c scsi: ufs-mediatek: add apply_dev_quirks variant operation 2020-02-24 08:36:50 +01:00
ufs-mediatek.h
ufs-qcom.c scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config() 2020-10-29 09:58:09 +01:00
ufs-qcom.h scsi: ufs-qcom: Implement device_reset vops 2019-09-07 16:36:03 -04:00
ufs-sysfs.c scsi: ufs: Fix up auto hibern8 enablement 2020-01-04 19:18:17 +01:00
ufs-sysfs.h
ufs.h scsi: ufs: revamp string descriptor reading 2019-08-07 21:40:37 -04:00
ufs_bsg.c scsi: ufs-bsg: Fix runtime PM imbalance on error 2020-06-24 17:50:47 +02:00
ufs_bsg.h
ufs_quirks.h scsi: ufs: Add DELAY_BEFORE_LPM quirk for Micron devices 2020-08-26 10:40:54 +02:00
ufshcd-dwc.c
ufshcd-dwc.h
ufshcd-pci.c scsi: ufshdc-pci: Add Intel PCI IDs for EHL 2019-06-26 22:42:28 -04:00
ufshcd-pltfrm.c scsi: ufshcd: use devm_platform_ioremap_resource() to simplify code 2019-09-07 16:42:07 -04:00
ufshcd-pltfrm.h
ufshcd.c scsi: ufs: Make sure clk scaling happens only when HBA is runtime ACTIVE 2020-12-16 10:56:56 +01:00
ufshcd.h scsi: ufs: fix Auto-Hibern8 error detection 2020-04-17 10:50:19 +02:00
ufshci-dwc.h
ufshci.h
unipro.h