scsi: ufs: ufs-pci: Force a full restore after suspend-to-disk
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 18 Oct 2021 15:10:04 +0000 (18:10 +0300)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 19 Oct 2021 03:19:44 +0000 (23:19 -0400)
commit4e5483b8440d01f6851a1388801088a6e0da0b56
treeb4a3bf23af94be01af211abc75890b1d64706c89
parent4a8f71014b4d56c4fb287607e844c0a9f68f46d9
scsi: ufs: ufs-pci: Force a full restore after suspend-to-disk

Implement the ->restore() PM operation and set the link to off, which will
force a full reset and restore.  This ensures that Host Performance Booster
is reset after suspend-to-disk.

The Host Performance Booster feature caches logical-to-physical mapping
information in the host memory.  After suspend-to-disk, such information is
not valid, so a full reset and restore is needed.

A full reset and restore is done if the SPM level is 5 or 6, but not for
other SPM levels, so this change fixes those cases.

A full reset and restore also restores base address registers, so that code
is removed.

Link: https://lore.kernel.org/r/20211018151004.284200-2-adrian.hunter@intel.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ufs/ufshcd-pci.c