Skip to content

Commit 70681aa

Browse files
debox1ij-intel
authored andcommitted
platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback
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>
1 parent 6f9cc5c commit 70681aa

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed

drivers/platform/x86/intel/pmc/adl.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,13 @@ int adl_core_init(struct pmc_dev *pmcdev)
314314
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
315315
int ret;
316316

317+
pmcdev->suspend = cnl_suspend;
318+
pmcdev->resume = cnl_resume;
319+
317320
pmc->map = &adl_reg_map;
318321
ret = get_primary_reg_base(pmc);
319322
if (ret)
320323
return ret;
321324

322-
/* Due to a hardware limitation, the GBE LTR blocks PC10
323-
* when a cable is attached. Tell the PMC to ignore it.
324-
*/
325-
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
326-
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
327-
328325
return 0;
329326
}

drivers/platform/x86/intel/pmc/cnp.c

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,21 +204,35 @@ const struct pmc_reg_map cnp_reg_map = {
204204
.etr3_offset = ETR3_OFFSET,
205205
};
206206

207+
void cnl_suspend(struct pmc_dev *pmcdev)
208+
{
209+
/*
210+
* Due to a hardware limitation, the GBE LTR blocks PC10
211+
* when a cable is attached. To unblock PC10 during suspend,
212+
* tell the PMC to ignore it.
213+
*/
214+
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
215+
}
216+
217+
int cnl_resume(struct pmc_dev *pmcdev)
218+
{
219+
pmc_core_send_ltr_ignore(pmcdev, 3, 0);
220+
221+
return pmc_core_resume_common(pmcdev);
222+
}
223+
207224
int cnp_core_init(struct pmc_dev *pmcdev)
208225
{
209226
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
210227
int ret;
211228

229+
pmcdev->suspend = cnl_suspend;
230+
pmcdev->resume = cnl_resume;
231+
212232
pmc->map = &cnp_reg_map;
213233
ret = get_primary_reg_base(pmc);
214234
if (ret)
215235
return ret;
216236

217-
/* Due to a hardware limitation, the GBE LTR blocks PC10
218-
* when a cable is attached. Tell the PMC to ignore it.
219-
*/
220-
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
221-
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
222-
223237
return 0;
224238
}

drivers/platform/x86/intel/pmc/core.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ int tgl_core_init(struct pmc_dev *pmcdev);
502502
int adl_core_init(struct pmc_dev *pmcdev);
503503
int mtl_core_init(struct pmc_dev *pmcdev);
504504

505+
void cnl_suspend(struct pmc_dev *pmcdev);
506+
int cnl_resume(struct pmc_dev *pmcdev);
507+
505508
#define pmc_for_each_mode(i, mode, pmcdev) \
506509
for (i = 0, mode = pmcdev->lpm_en_modes[i]; \
507510
i < pmcdev->num_lpm_modes; \

drivers/platform/x86/intel/pmc/mtl.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,8 @@ static void mtl_d3_fixup(void)
979979
static int mtl_resume(struct pmc_dev *pmcdev)
980980
{
981981
mtl_d3_fixup();
982+
pmc_core_send_ltr_ignore(pmcdev, 3, 0);
983+
982984
return pmc_core_resume_common(pmcdev);
983985
}
984986

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

990992
mtl_d3_fixup();
991993

994+
pmcdev->suspend = cnl_suspend;
992995
pmcdev->resume = mtl_resume;
993996

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

1005-
/* Due to a hardware limitation, the GBE LTR blocks PC10
1006-
* when a cable is attached. Tell the PMC to ignore it.
1007-
*/
1008-
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
1009-
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
1010-
10111008
return 0;
10121009
}

drivers/platform/x86/intel/pmc/tgl.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,15 @@ int tgl_core_init(struct pmc_dev *pmcdev)
259259
int ret;
260260

261261
pmc->map = &tgl_reg_map;
262+
263+
pmcdev->suspend = cnl_suspend;
264+
pmcdev->resume = cnl_resume;
265+
262266
ret = get_primary_reg_base(pmc);
263267
if (ret)
264268
return ret;
265269

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

273272
return 0;
274273
}

0 commit comments

Comments
 (0)