Skip to content

Commit 28a60bb

Browse files
ahunter6martinkpetersen
authored andcommitted
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 commit bb98507 ("scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers") and commit fe06b7c ("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 <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 6de7435 commit 28a60bb

File tree

1 file changed

+9
-37
lines changed

1 file changed

+9
-37
lines changed

drivers/ufs/host/ufshcd-pci.c

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,12 @@
2222

2323
#define MAX_SUPP_MAC 64
2424

25-
struct ufs_host {
26-
void (*late_init)(struct ufs_hba *hba);
27-
};
28-
2925
enum intel_ufs_dsm_func_id {
3026
INTEL_DSM_FNS = 0,
3127
INTEL_DSM_RESET = 1,
3228
};
3329

3430
struct intel_host {
35-
struct ufs_host ufs_host;
3631
u32 dsm_fns;
3732
u32 active_ltr;
3833
u32 idle_ltr;
@@ -434,8 +429,14 @@ static int ufs_intel_ehl_init(struct ufs_hba *hba)
434429
return ufs_intel_common_init(hba);
435430
}
436431

437-
static void ufs_intel_lkf_late_init(struct ufs_hba *hba)
432+
static int ufs_intel_lkf_init(struct ufs_hba *hba)
438433
{
434+
int err;
435+
436+
hba->nop_out_timeout = 200;
437+
hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
438+
hba->caps |= UFSHCD_CAP_CRYPTO;
439+
err = ufs_intel_common_init(hba);
439440
/* LKF always needs a full reset, so set PM accordingly */
440441
if (hba->caps & UFSHCD_CAP_DEEPSLEEP) {
441442
hba->spm_lvl = UFS_PM_LVL_6;
@@ -444,19 +445,6 @@ static void ufs_intel_lkf_late_init(struct ufs_hba *hba)
444445
hba->spm_lvl = UFS_PM_LVL_5;
445446
hba->rpm_lvl = UFS_PM_LVL_5;
446447
}
447-
}
448-
449-
static int ufs_intel_lkf_init(struct ufs_hba *hba)
450-
{
451-
struct ufs_host *ufs_host;
452-
int err;
453-
454-
hba->nop_out_timeout = 200;
455-
hba->quirks |= UFSHCD_QUIRK_BROKEN_AUTO_HIBERN8;
456-
hba->caps |= UFSHCD_CAP_CRYPTO;
457-
err = ufs_intel_common_init(hba);
458-
ufs_host = ufshcd_get_variant(hba);
459-
ufs_host->late_init = ufs_intel_lkf_late_init;
460448
return err;
461449
}
462450

@@ -468,23 +456,12 @@ static int ufs_intel_adl_init(struct ufs_hba *hba)
468456
return ufs_intel_common_init(hba);
469457
}
470458

471-
static void ufs_intel_mtl_late_init(struct ufs_hba *hba)
459+
static int ufs_intel_mtl_init(struct ufs_hba *hba)
472460
{
473461
hba->rpm_lvl = UFS_PM_LVL_2;
474462
hba->spm_lvl = UFS_PM_LVL_2;
475-
}
476-
477-
static int ufs_intel_mtl_init(struct ufs_hba *hba)
478-
{
479-
struct ufs_host *ufs_host;
480-
int err;
481-
482463
hba->caps |= UFSHCD_CAP_CRYPTO | UFSHCD_CAP_WB_EN;
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;
464+
return ufs_intel_common_init(hba);
488465
}
489466

490467
static int ufs_qemu_get_hba_mac(struct ufs_hba *hba)
@@ -614,7 +591,6 @@ static void ufshcd_pci_remove(struct pci_dev *pdev)
614591
static int
615592
ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
616593
{
617-
struct ufs_host *ufs_host;
618594
struct ufs_hba *hba;
619595
void __iomem *mmio_base;
620596
int err;
@@ -647,10 +623,6 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
647623
return err;
648624
}
649625

650-
ufs_host = ufshcd_get_variant(hba);
651-
if (ufs_host && ufs_host->late_init)
652-
ufs_host->late_init(hba);
653-
654626
pm_runtime_put_noidle(&pdev->dev);
655627
pm_runtime_allow(&pdev->dev);
656628

0 commit comments

Comments
 (0)