mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86/intel/pmc: rate-limit LTR scale-factor warning
@ 2026-05-23 11:45 Mike Bommarito
  2026-05-26 17:32 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Bommarito @ 2026-05-23 11:45 UTC (permalink / raw)
  To: Rajneesh Bhardwaj, David E Box
  Cc: Hans de Goede, Ilpo Jarvinen, platform-driver-x86, linux-kernel

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>
---
Tested on Framework Laptop 13 (Intel Core Ultra 5 125H, BIOS 3.06)
running Linux 7.1-rc4 with this patch applied, across multiple boots
over three days.

Excerpt from /var/log/kern.log spanning the kernel switch:

    2026-05-21T08:05:07 mobile5 kernel: intel_pmc_core: Invalid LTR scale factor.
    2026-05-21T08:07:07 mobile5 kernel: message repeated 9 times: [ intel_pmc_core: Invalid LTR scale factor.]
    2026-05-21T10:19:58 mobile5 kernel: intel_pmc_core: Invalid LTR scale factor 7 (only 0-5 are valid per PCIe spec)

The first two lines are stock 7.1-rc4 (10 unrate-limited firings inside
a 2-minute window, no scale value in the message).  The third line is
the patched kernel (single firing per boot, scale value present).

 drivers/platform/x86/intel/pmc/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index d91e1ab842d6..e5cb70ba5707 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -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;
 	}
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86/intel/pmc: rate-limit LTR scale-factor warning
  2026-05-23 11:45 [PATCH] platform/x86/intel/pmc: rate-limit LTR scale-factor warning Mike Bommarito
@ 2026-05-26 17:32 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2026-05-26 17:32 UTC (permalink / raw)
  To: Rajneesh Bhardwaj, David E Box, Mike Bommarito
  Cc: Hans de Goede, platform-driver-x86, linux-kernel

On Sat, 23 May 2026 07:45:17 -0400, Mike Bommarito wrote:

> 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.
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86/intel/pmc: rate-limit LTR scale-factor warning
      commit: 4c7f5762cc5baf2819e8868da6571fb40bfea969

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-26 17:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-23 11:45 [PATCH] platform/x86/intel/pmc: rate-limit LTR scale-factor warning Mike Bommarito
2026-05-26 17:32 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®