Skip to content

Commit 6f9cc5c

Browse files
debox1ij-intel
authored andcommitted
platform/x86/intel/pmc: Allow reenabling LTRs
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 during probe. The fix will move the ignore to occur at suspend-time (so as to not affect suspend power). This will require the ability to enable the LTR again on resume. Modify pmc_core_send_ltr_ignore() to allow enabling an LTR. Fixes: 8049512 ("platform/x86:intel/pmc: Combine core_init() and core_configure()") Signed-off-by: "David E. Box" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 7c13f36 commit 6f9cc5c

File tree

6 files changed

+11
-8
lines changed

6 files changed

+11
-8
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ int adl_core_init(struct pmc_dev *pmcdev)
323323
* when a cable is attached. Tell the PMC to ignore it.
324324
*/
325325
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
326-
pmc_core_send_ltr_ignore(pmcdev, 3);
326+
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
327327

328328
return 0;
329329
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ int cnp_core_init(struct pmc_dev *pmcdev)
218218
* when a cable is attached. Tell the PMC to ignore it.
219219
*/
220220
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
221-
pmc_core_send_ltr_ignore(pmcdev, 3);
221+
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
222222

223223
return 0;
224224
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ static int pmc_core_pll_show(struct seq_file *s, void *unused)
460460
}
461461
DEFINE_SHOW_ATTRIBUTE(pmc_core_pll);
462462

463-
int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value)
463+
int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value, int ignore)
464464
{
465465
struct pmc *pmc;
466466
const struct pmc_reg_map *map;
@@ -498,7 +498,10 @@ int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value)
498498
mutex_lock(&pmcdev->lock);
499499

500500
reg = pmc_core_reg_read(pmc, map->ltr_ignore_offset);
501-
reg |= BIT(ltr_index);
501+
if (ignore)
502+
reg |= BIT(ltr_index);
503+
else
504+
reg &= ~BIT(ltr_index);
502505
pmc_core_reg_write(pmc, map->ltr_ignore_offset, reg);
503506

504507
mutex_unlock(&pmcdev->lock);
@@ -521,7 +524,7 @@ static ssize_t pmc_core_ltr_ignore_write(struct file *file,
521524
if (err)
522525
return err;
523526

524-
err = pmc_core_send_ltr_ignore(pmcdev, value);
527+
err = pmc_core_send_ltr_ignore(pmcdev, value, 1);
525528

526529
return err == 0 ? count : err;
527530
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ extern const struct pmc_bit_map *mtl_ioem_lpm_maps[];
488488
extern const struct pmc_reg_map mtl_ioem_reg_map;
489489

490490
extern void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev);
491-
extern int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value);
491+
int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value, int ignore);
492492

493493
int pmc_core_resume_common(struct pmc_dev *pmcdev);
494494
int get_primary_reg_base(struct pmc *pmc);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ int mtl_core_init(struct pmc_dev *pmcdev)
10061006
* when a cable is attached. Tell the PMC to ignore it.
10071007
*/
10081008
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
1009-
pmc_core_send_ltr_ignore(pmcdev, 3);
1009+
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
10101010

10111011
return 0;
10121012
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ int tgl_core_init(struct pmc_dev *pmcdev)
268268
* when a cable is attached. Tell the PMC to ignore it.
269269
*/
270270
dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n");
271-
pmc_core_send_ltr_ignore(pmcdev, 3);
271+
pmc_core_send_ltr_ignore(pmcdev, 3, 1);
272272

273273
return 0;
274274
}

0 commit comments

Comments
 (0)