scsi: ufs: ufs-pci: Remove UFS PCI driver's ->late_init() call back
->late_init() was introduced to allow the default values for rpm_lvl and spm_lvl to be set. Since commitbb9850704c("scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers") and commitfe06b7c07f("scsi: ufs: core: Set default runtime/system PM levels before ufshcd_hba_init()"), those default values can be set in the ->init() variant call back. Move the setting of default values for rpm_lvl and spm_lvl to ->init() and remove ->late_init(). Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20250723165856.145750-4-adrian.hunter@intel.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
6de7435e6b
commit
28a60bbbe7
@@ -22,17 +22,12 @@
|
||||
|
||||
#define MAX_SUPP_MAC 64
|
||||
|
||||
struct ufs_host {
|
||||
void (*late_init)(struct ufs_hba *hba);
|
||||
};
|
||||
|
||||
enum intel_ufs_dsm_func_id {
|
||||
INTEL_DSM_FNS = 0,
|
||||
INTEL_DSM_RESET = 1,
|
||||
};
|
||||
|
||||
struct intel_host {
|
||||
struct ufs_host ufs_host;
|
||||
u32 dsm_fns;
|
||||
u32 active_ltr;
|
||||
u32 idle_ltr;
|
||||
@@ -434,8 +429,14 @@ static int ufs_intel_ehl_init(struct ufs_hba *hba)
|
||||
return ufs_intel_common_init(hba);
|
||||
}
|
||||
|
||||
static void ufs_intel_lkf_late_init(struct ufs_hba *hba)
|
||||
static int ufs_intel_lkf_init(struct ufs_hba *hba)
|
||||
{
|
||||
int err;
|
||||
|
||||
hba->nop_out_timeout = 200;
|
||||
hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
|
||||
hba->caps |= UFSHCD_CAP_CRYPTO;
|
||||
err = ufs_intel_common_init(hba);
|
||||
/* LKF always needs a full reset, so set PM accordingly */
|
||||
if (hba->caps & UFSHCD_CAP_DEEPSLEEP) {
|
||||
hba->spm_lvl = UFS_PM_LVL_6;
|
||||
@@ -444,19 +445,6 @@ static void ufs_intel_lkf_late_init(struct ufs_hba *hba)
|
||||
hba->spm_lvl = UFS_PM_LVL_5;
|
||||
hba->rpm_lvl = UFS_PM_LVL_5;
|
||||
}
|
||||
}
|
||||
|
||||
static int ufs_intel_lkf_init(struct ufs_hba *hba)
|
||||
{
|
||||
struct ufs_host *ufs_host;
|
||||
int err;
|
||||
|
||||
hba->nop_out_timeout = 200;
|
||||
hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
|
||||
hba->caps |= UFSHCD_CAP_CRYPTO;
|
||||
err = ufs_intel_common_init(hba);
|
||||
ufs_host = ufshcd_get_variant(hba);
|
||||
ufs_host->late_init = ufs_intel_lkf_late_init;
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -468,23 +456,12 @@ static int ufs_intel_adl_init(struct ufs_hba *hba)
|
||||
return ufs_intel_common_init(hba);
|
||||
}
|
||||
|
||||
static void ufs_intel_mtl_late_init(struct ufs_hba *hba)
|
||||
static int ufs_intel_mtl_init(struct ufs_hba *hba)
|
||||
{
|
||||
hba->rpm_lvl = UFS_PM_LVL_2;
|
||||
hba->spm_lvl = UFS_PM_LVL_2;
|
||||
}
|
||||
|
||||
static int ufs_intel_mtl_init(struct ufs_hba *hba)
|
||||
{
|
||||
struct ufs_host *ufs_host;
|
||||
int err;
|
||||
|
||||
hba->caps |= UFSHCD_CAP_CRYPTO | UFSHCD_CAP_WB_EN;
|
||||
err = ufs_intel_common_init(hba);
|
||||
/* Get variant after it is set in ufs_intel_common_init() */
|
||||
ufs_host = ufshcd_get_variant(hba);
|
||||
ufs_host->late_init = ufs_intel_mtl_late_init;
|
||||
return err;
|
||||
return ufs_intel_common_init(hba);
|
||||
}
|
||||
|
||||
static int ufs_qemu_get_hba_mac(struct ufs_hba *hba)
|
||||
@@ -614,7 +591,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
|
||||
static int
|
||||
ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
{
|
||||
struct ufs_host *ufs_host;
|
||||
struct ufs_hba *hba;
|
||||
void __iomem *mmio_base;
|
||||
int err;
|
||||
@@ -647,10 +623,6 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
return err;
|
||||
}
|
||||
|
||||
ufs_host = ufshcd_get_variant(hba);
|
||||
if (ufs_host && ufs_host->late_init)
|
||||
ufs_host->late_init(hba);
|
||||
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_allow(&pdev->dev);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user