Skip to content

Commit

Permalink
platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback
Browse files Browse the repository at this point in the history
Commit 8049512 ("platform/x86:intel/pmc: Combine core_init() and
core_configure()") caused a network performance regression due to the GBE
LTR ignore that it added at probe. This was needed in order to allow the
SoC to enter the deepest Package C state. To fix the regression and at
least support PC10 during suspend, move the LTR ignore from probe to the
suspend callback, and enable it again on resume. This solution will allow
PC10 during suspend but restrict Package C entry at runtime to no deeper
than PC8/9 while a network cable it attach to the PCH LAN.

Fixes: 8049512 ("platform/x86:intel/pmc: Combine core_init() and core_configure()")
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20231223032548.1680738-6-david.e.box@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  • Loading branch information
David E. Box authored and Ilpo Järvinen committed Dec 29, 2023
1 parent 6f9cc5c commit 70681aa
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 23 deletions.
9 changes: 3 additions & 6 deletions drivers/platform/x86/intel/pmc/adl.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,13 @@ int adl_core_init(struct pmc_dev *pmcdev)
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

pmc->map = &adl_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3, 1);

return 0;
}
26 changes: 20 additions & 6 deletions drivers/platform/x86/intel/pmc/cnp.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,21 +204,35 @@ const struct pmc_reg_map cnp_reg_map = {
.etr3_offset = ETR3_OFFSET,
};

void cnl_suspend(struct pmc_dev *pmcdev)
{
/*
* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. To unblock PC10 during suspend,
* tell the PMC to ignore it.
*/
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
}

int cnl_resume(struct pmc_dev *pmcdev)
{
pmc_core_send_ltr_ignore(pmcdev, 3, 0);

return pmc_core_resume_common(pmcdev);
}

int cnp_core_init(struct pmc_dev *pmcdev)
{
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

pmc->map = &cnp_reg_map;
ret = get_primary_reg_base(pmc);
if (ret)
return ret;

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3, 1);

return 0;
}
3 changes: 3 additions & 0 deletions drivers/platform/x86/intel/pmc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ int tgl_core_init(struct pmc_dev *pmcdev);
int adl_core_init(struct pmc_dev *pmcdev);
int mtl_core_init(struct pmc_dev *pmcdev);

void cnl_suspend(struct pmc_dev *pmcdev);
int cnl_resume(struct pmc_dev *pmcdev);

#define pmc_for_each_mode(i, mode, pmcdev) \
for (i = 0, mode = pmcdev->lpm_en_modes[i]; \
i < pmcdev->num_lpm_modes; \
Expand Down
9 changes: 3 additions & 6 deletions drivers/platform/x86/intel/pmc/mtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,8 @@ static void mtl_d3_fixup(void)
static int mtl_resume(struct pmc_dev *pmcdev)
{
mtl_d3_fixup();
pmc_core_send_ltr_ignore(pmcdev, 3, 0);

return pmc_core_resume_common(pmcdev);
}

Expand All @@ -989,6 +991,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)

mtl_d3_fixup();

pmcdev->suspend = cnl_suspend;
pmcdev->resume = mtl_resume;

pmcdev->regmap_list = mtl_pmc_info_list;
Expand All @@ -1002,11 +1005,5 @@ int mtl_core_init(struct pmc_dev *pmcdev)
return ret;
}

/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3, 1);

return 0;
}
9 changes: 4 additions & 5 deletions drivers/platform/x86/intel/pmc/tgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,15 @@ int tgl_core_init(struct pmc_dev *pmcdev)
int ret;

pmc->map = &tgl_reg_map;

pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;

ret = get_primary_reg_base(pmc);
if (ret)
return ret;

pmc_core_get_tgl_lpm_reqs(pmcdev->pdev);
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
pmc_core_send_ltr_ignore(pmcdev, 3, 1);

return 0;
}

0 comments on commit 70681aa

Please sign in to comment.