]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
platform/x86/intel/pmc: rate-limit LTR scale-factor warning
authorMike Bommarito <michael.bommarito@gmail.com>
Sat, 23 May 2026 11:45:17 +0000 (07:45 -0400)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 9 Jun 2026 07:34:59 +0000 (10:34 +0300)
convert_ltr_scale() emits an unconditional pr_warn() whenever an LTR row
encoded by hardware has a scale-factor field of 6 or 7 (reserved values
per the PCIe LTR ECN).  The function is called twice per LTR row (snoop
+ non-snoop) by pmc_core_ltr_show(), which is invoked on every read of
/sys/kernel/debug/pmc_core/ltr_show as well as during certain platform
driver activity.

On a Meteor Lake laptop with an Intel AX210 Wi-Fi card, this produces
4-12 "Invalid LTR scale factor." lines per second in dmesg, with no
context to help identify which PMC IP / row carries the bad value.

Switch to pr_warn_once() so the warning still flags the spec violation
once per boot, and include the offending scale value in the message.
Identifying the originating LTR row would require restructuring the
caller's loop to perform the validity check itself; that is left as a
separate change.

Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Mike Bommarito <michael.bommarito@gmail.com>
Link: https://patch.msgid.link/20260523114517.101305-1-michael.bommarito@gmail.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/core.c

index 3adae8fe8b306642095a51e0dfd9497daf8b72cd..825ba5fa0bcb8322337cf28ed54cce6dd28fac6b 100644 (file)
@@ -623,7 +623,8 @@ static u32 convert_ltr_scale(u32 val)
         * ----------------------------------------------
         */
        if (val > 5) {
-               pr_warn("Invalid LTR scale factor.\n");
+               pr_warn_once("Invalid LTR scale factor %u (only 0-5 are valid per PCIe spec)\n",
+                            val);
                return 0;
        }