]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86/intel/pmc: Move GBE LTR ignore to suspend callback
authorDavid E. Box <david.e.box@linux.intel.com>
Sat, 23 Dec 2023 03:25:45 +0000 (19:25 -0800)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 29 Dec 2023 13:31:22 +0000 (15:31 +0200)
Commit 804951203aa5 ("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: 804951203aa5 ("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>
drivers/platform/x86/intel/pmc/adl.c
drivers/platform/x86/intel/pmc/cnp.c
drivers/platform/x86/intel/pmc/core.h
drivers/platform/x86/intel/pmc/mtl.c
drivers/platform/x86/intel/pmc/tgl.c

index a887c388cf16d3c8a96945314f942a72e6dfd714..606f7678bcb0a1c747bb933103ebf4ac031bc9e7 100644 (file)
@@ -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;
 }
index 10498204962cdf576c5f22897f30d6c9636dfc9e..98b36651201a06c34abb83854cb67475d47faf9e 100644 (file)
@@ -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;
 }
index 71ba7d691d691f357f8ecc08d376805133df23a4..b66dacbfb94bf7198b2265f3e8ed44bd48b7bee8 100644 (file)
@@ -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;                 \
index 71dc11811e1129dbcbff816a84f7082f590e5dd8..504e3e273c323b3683c897f5390099674cbc64df 100644 (file)
@@ -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);
 }
 
@@ -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;
@@ -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;
 }
index 078263db24c7a0632e4490dfc01986218ed3db87..e88d3d00c8539315775a182ae409bd3e164845b6 100644 (file)
@@ -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;
 }