Skip to content

Commit 947ee26

Browse files
ahunter6gregkh
authored andcommitted
scsi: ufs: ufs-pci: Fix default runtime and system PM levels
commit 6de7435 upstream. Intel MTL-like host controllers support auto-hibernate. Using auto-hibernate with manual (driver initiated) hibernate produces more complex operation. For example, the host controller will have to exit auto-hibernate simply to allow the driver to enter hibernate state manually. That is not recommended. The default rpm_lvl and spm_lvl is 3, which includes manual hibernate. Change the default values to 2, which does not. Note, to be simpler to backport to stable kernels, utilize the UFS PCI driver's ->late_init() call back. Recent commits have made it possible to set up a controller-specific default in the regular ->init() call back, but not all stable kernels have those changes. Fixes: 4049f7a ("scsi: ufs: ufs-pci: Add support for Intel MTL") Cc: stable@vger.kernel.org Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20250723165856.145750-3-adrian.hunter@intel.com Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 626a57f commit 947ee26

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

drivers/ufs/host/ufshcd-pci.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,23 @@ static int ufs_intel_adl_init(struct ufs_hba *hba)
468468
return ufs_intel_common_init(hba);
469469
}
470470

471+
static void ufs_intel_mtl_late_init(struct ufs_hba *hba)
472+
{
473+
hba->rpm_lvl = UFS_PM_LVL_2;
474+
hba->spm_lvl = UFS_PM_LVL_2;
475+
}
476+
471477
static int ufs_intel_mtl_init(struct ufs_hba *hba)
472478
{
479+
struct ufs_host *ufs_host;
480+
int err;
481+
473482
hba->caps |= UFSHCD_CAP_CRYPTO | UFSHCD_CAP_WB_EN;
474-
return ufs_intel_common_init(hba);
483+
err = ufs_intel_common_init(hba);
484+
/* Get variant after it is set in ufs_intel_common_init() */
485+
ufs_host = ufshcd_get_variant(hba);
486+
ufs_host->late_init = ufs_intel_mtl_late_init;
487+
return err;
475488
}
476489

477490
static int ufs_qemu_get_hba_mac(struct ufs_hba *hba)

0 commit comments

Comments
 (0)