platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback

Commit 804951203a ("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: 804951203a ("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>
This commit is contained in:
David E. Box 2023-12-22 19:25:45 -08:00 committed by Ilpo Järvinen
parent 6f9cc5c1f9
commit 70681aa074
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
5 changed files with 33 additions and 23 deletions

View File

@ -314,16 +314,13 @@ int adl_core_init(struct pmc_dev *pmcdev)
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret; int ret;
pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;
pmc->map = &adl_reg_map; pmc->map = &adl_reg_map;
ret = get_primary_reg_base(pmc); ret = get_primary_reg_base(pmc);
if (ret) if (ret)
return 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; return 0;
} }

View File

@ -204,21 +204,35 @@ const struct pmc_reg_map cnp_reg_map = {
.etr3_offset = ETR3_OFFSET, .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) int cnp_core_init(struct pmc_dev *pmcdev)
{ {
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
int ret; int ret;
pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;
pmc->map = &cnp_reg_map; pmc->map = &cnp_reg_map;
ret = get_primary_reg_base(pmc); ret = get_primary_reg_base(pmc);
if (ret) if (ret)
return 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; return 0;
} }

View File

@ -502,6 +502,9 @@ int tgl_core_init(struct pmc_dev *pmcdev);
int adl_core_init(struct pmc_dev *pmcdev); int adl_core_init(struct pmc_dev *pmcdev);
int mtl_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) \ #define pmc_for_each_mode(i, mode, pmcdev) \
for (i = 0, mode = pmcdev->lpm_en_modes[i]; \ for (i = 0, mode = pmcdev->lpm_en_modes[i]; \
i < pmcdev->num_lpm_modes; \ i < pmcdev->num_lpm_modes; \

View File

@ -979,6 +979,8 @@ static void mtl_d3_fixup(void)
static int mtl_resume(struct pmc_dev *pmcdev) static int mtl_resume(struct pmc_dev *pmcdev)
{ {
mtl_d3_fixup(); mtl_d3_fixup();
pmc_core_send_ltr_ignore(pmcdev, 3, 0);
return pmc_core_resume_common(pmcdev); return pmc_core_resume_common(pmcdev);
} }
@ -989,6 +991,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)
mtl_d3_fixup(); mtl_d3_fixup();
pmcdev->suspend = cnl_suspend;
pmcdev->resume = mtl_resume; pmcdev->resume = mtl_resume;
pmcdev->regmap_list = mtl_pmc_info_list; pmcdev->regmap_list = mtl_pmc_info_list;
@ -1002,11 +1005,5 @@ int mtl_core_init(struct pmc_dev *pmcdev)
return 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; return 0;
} }

View File

@ -259,16 +259,15 @@ int tgl_core_init(struct pmc_dev *pmcdev)
int ret; int ret;
pmc->map = &tgl_reg_map; pmc->map = &tgl_reg_map;
pmcdev->suspend = cnl_suspend;
pmcdev->resume = cnl_resume;
ret = get_primary_reg_base(pmc); ret = get_primary_reg_base(pmc);
if (ret) if (ret)
return ret; return ret;
pmc_core_get_tgl_lpm_reqs(pmcdev->pdev); 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; return 0;
} }