linux_dsm_epyc7002/drivers/scsi/ufs
Stanley Chu 51dd905bd2 scsi: ufs: Fix WriteBooster flush during runtime suspend
Currently UFS host driver promises VCC supply if UFS device needs to do
WriteBooster flush during runtime suspend.

However the UFS specification mentions:

"While the flushing operation is in progress, the device is in Active power
mode."

Therefore UFS host driver needs to promise more: Keep UFS device as "Active
power mode", otherwise UFS device shall not do any flush if device enters
Sleep or PowerDown power mode.  Similarly, the same promises shall be
applied if device needs urgent BKOP during runtime suspend.

Fix this by not changing device power mode if WriteBooster flush or urgent
BKOP is required in ufshcd_suspend().

Now, if device finishes its job but is not resumed for a very long time,
system will have unnecessary power drain because VCC is still supplied. A
method to re-check the threshold of keeping VCC supply is required to fix
the power drain. However, the threshold re-check needs to re-activate the
link first because the decision depends on the latest device status.

Also introduce a delayed work to force runtime resume after a certain delay
during runtime suspend. This makes threshold re-check happen natually in
the entry of the next runtime-suspend. The device can continue its
WriteBooster flush or urgent BKOP jobs soon after resumed if device has no
upcoming requests and link enters hibern8 state either by Auto-Hibern8 or
hibern8 during clk-gating scheme. This solution not only prevents power
drain but also makes as much use of time as possible for device's
background jobs.

Link: https://lore.kernel.org/r/20200522083212.4008-5-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2020-05-26 21:14:08 -04:00
..
cdns-pltfrm.c scsi: ufs: introduce common function to disable host TX LCC 2020-02-12 19:27:16 -05:00
Kconfig scsi: docs: convert ufs.txt to ReST 2020-03-11 23:08:03 -04:00
Makefile scsi: ufs: Add driver for TI wrapper for Cadence UFS IP 2019-11-12 22:21:33 -05:00
tc-dwc-g210-pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tc-dwc-g210-pltfrm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tc-dwc-g210.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
tc-dwc-g210.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ti-j721e-ufs.c scsi: ufs: Add driver for TI wrapper for Cadence UFS IP 2019-11-12 22:21:33 -05:00
ufs_bsg.c scsi: ufs: Give an unique ID to each ufs-bsg 2019-12-09 18:46:18 -05:00
ufs_bsg.h scsi: ufs: Add a bsg endpoint that supports UPIUs 2018-10-10 23:09:46 -04:00
ufs_quirks.h scsi: ufs: Enable WriteBooster on some pre-3.1 UFS devices 2020-05-11 22:48:41 -04:00
ufs-hisi.c scsi: ufs: introduce common function to disable host TX LCC 2020-02-12 19:27:16 -05:00
ufs-hisi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 471 2019-06-19 17:09:11 +02:00
ufs-mediatek.c scsi: ufs-mediatek: Customize WriteBooster flush policy 2020-05-14 21:02:22 -04:00
ufs-mediatek.h scsi: ufs-mediatek: customize the delay for enabling host 2020-03-26 22:07:16 -04:00
ufs-qcom.c scsi: ufs-qcom: Fix scheduling while atomic issue 2020-05-26 20:05:02 -04:00
ufs-qcom.h scsi: ufs-qcom: Add reset control support for host controller 2019-11-18 23:15:50 -05:00
ufs-sysfs.c scsi: ufs: Fix index of attributes query for WriteBooster feature 2020-05-26 21:14:07 -04:00
ufs-sysfs.h scsi: ufs: sysfs: Use the correct style for SPDX License Identifier 2020-01-02 21:57:44 -05:00
ufs.h scsi: ufs: Fix WriteBooster flush during runtime suspend 2020-05-26 21:14:08 -04:00
ufshcd-dwc.c scsi: ufs: make array setup_attrs static const, makes object smaller 2019-09-30 22:47:21 -04:00
ufshcd-dwc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ufshcd-pci.c scsi: ufs: introduce common function to disable host TX LCC 2020-02-12 19:27:16 -05:00
ufshcd-pltfrm.c scsi: ufs: ufshcd: Remove dev_err() on platform_get_irq() failure 2019-11-12 22:21:34 -05:00
ufshcd-pltfrm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
ufshcd.c scsi: ufs: Fix WriteBooster flush during runtime suspend 2020-05-26 21:14:08 -04:00
ufshcd.h scsi: ufs: Fix WriteBooster flush during runtime suspend 2020-05-26 21:14:08 -04:00
ufshci-dwc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ufshci.h scsi: ufs: Fix irq return code 2019-11-19 21:37:09 -05:00
unipro.h scsi: ufs: Select INITIAL ADAPT type for HS Gear4 2020-02-12 19:34:22 -05:00