• Adrian Hunter's avatar
    scsi: ufs-pci: Fix restore from S4 for Intel controllers · c763729a
    Adrian Hunter authored
    Currently, ufshcd-pci is the only UFS driver with support for
    suspend-to-disk PM callbacks (i.e. freeze/thaw/restore/poweroff). These
    callbacks are set by the macro SET_SYSTEM_SLEEP_PM_OPS to the same
    functions as system suspend/resume. That will work with spm_lvl 5 because
    spm_lvl 5 will result in a full restore for the ->restore() callback.  In
    the absence of a full restore, the host controller registers will have
    values set up by the restore kernel (the kernel that boots and loads the
    restore image) which are not necessarily the same. However it turns out,
    the only registers that sometimes need restore are the base address
    registers. This has gone un-noticed because, depending on IOMMU settings,
    the kernel can end up allocating the same addresses every time.
    
    For Intel controllers, an spm_lvl other than 5 can be used, so to support
    S4 (suspend-to-disk) with spm_lvl other than 5, restore the base address
    registers.
    
    Link: https://lore.kernel.org/r/20201207083120.26732-2-adrian.hunter@intel.comSigned-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    c763729a
ufshcd-pci.c 8.7 KB