scsi: ufs: Let devices remain runtime suspended during system suspend
authorAdrian Hunter <adrian.hunter@intel.com>
Wed, 27 Oct 2021 13:06:14 +0000 (16:06 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 30 Nov 2021 03:37:04 +0000 (22:37 -0500)
commitddba1cf7a506b09b3583bcac2d64ec88bd4e3a96
tree8f64fa994690f7ced58bdeb48f63167013569204
parent659109a45c6c5a3c81a8ce35dea59318c44cfa6e
scsi: ufs: Let devices remain runtime suspended during system suspend

If the UFS Device WLUN is runtime suspended and is in the same power mode,
link state, and b_rpm_dev_flush_capable (BKOP or WB buffer flush etc)
state, then it can remain runtime suspended instead of being runtime
resumed and then system suspended.

The following patch has cleared the way for that to happen:

  scsi: core: pm: Only runtime resume if necessary

So amend the logic accordingly.

Note, the ufs-hisi driver uses different RPM and SPM, but it is made
explicit by a new parameter to suspend prepare.

Link: https://lore.kernel.org/r/20211027130614.406985-2-adrian.hunter@intel.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufs-hisi.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshcd.h