Bug 218143

Summary: platform/x86/intel/pmc: regression found in commit 804951203aa541ad6720c9726c173d18aeb3ab6b
Product: Drivers Reporter: James (jahutchinson99)
Component: Platform_x86Assignee: drivers_platform_x86 (drivers_platform_x86)
Status: NEW ---    
Severity: high CC: david.e.box, jwrdegoede, regressions
Priority: P3    
Hardware: Intel   
OS: Linux   
Kernel Version: Subsystem:
Regression: Yes Bisected commit-id: 804951203aa541ad6720c9726c173d18aeb3ab6b
Attachments: Remove GBE LTR ignore

Description James 2023-11-14 11:06:26 UTC
Running here on an Intel NUC 8i3BEH Coffee Lake machine under Arch Linux.

Connected to this machine I have 4x USB DVB Cards (2xDVBSky S960
DVB-S2 adapters & 2xGeniatech T230 DVB-T2 adapters), and I stream TV
Channels around the house via Tvheadend.

Since linux kernel v6.5 onwards I noticed a bad performance regression
whereby the streams are basically unstable. There are tons of
continuity errors in the Tvheadend logfile, and the picture and sound
are badly broken up as though the system is throttled or does not have
the bandwidth to cope with the streams.

Sometimes the stream will work for a minute or so after reboot, before
then becoming unstable, and then seems to remain unstable until the
next cold reboot.

I dropped back to v6.1 LTS (where everything is fine) and re-tested
following the release of v6.6...
...the problem had not gone away so I performed a git bisect to
identify the culprit and found this to be:

804951203aa541ad6720c9726c173d18aeb3ab6b: platform/x86:intel/pmc:
Combine core_init() and core_configure()

I can work around the issue by either reverting this commit or by
disabling CONFIG_INTEL_PMC_CORE and rebuilding the kernel manually,
either of which results in perfect DVB streaming once more.

Happy to test any potential patches or otherwise provide further
information as required.
Comment 1 David Box 2023-11-14 15:13:44 UTC
Created attachment 305404 [details]
Remove GBE LTR ignore

Looks like your NUC is using a Comet Lake CPU. Please try the attached patch which removes a workaround for an issue that blocked low power states on the CPU.
Comment 2 James 2023-11-15 08:45:53 UTC
Hi David,

I've been testing your patch for removing GBE LTR ignore and it works perfectly on my Intel NUC 8i3BEH.

The CPU on NUC 8i3BEH is as follows:

$ lscpu

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         39 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Core(TM) i3-8109U CPU @ 3.00GHz
    CPU family:          6
    Model:               142
    Thread(s) per core:  2
    Core(s) per socket:  2
    Socket(s):           1
    Stepping:            10
    CPU(s) scaling MHz:  100%
    CPU max MHz:         3000.0000
    CPU min MHz:         400.0000
    BogoMIPS:            6000.00
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm con
                         stant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma
                         cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb pti ssbd ib
                         rs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsave
                         opt xsavec xgetbv1 xsaves dtherm arat pln pts hwp hwp_notify hwp_act_window hwp_epp vnmi md_clear flush_l1d arch_capabilities
Virtualization features:
  Virtualization:        VT-x
Caches (sum of all):
  L1d:                   64 KiB (2 instances)
  L1i:                   64 KiB (2 instances)
  L2:                    512 KiB (2 instances)
  L3:                    4 MiB (1 instance)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-3
Vulnerabilities:
  Gather data sampling:  Mitigation; Microcode
  Itlb multihit:         KVM: Mitigation: VMX disabled
  L1tf:                  Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
  Mds:                   Mitigation; Clear CPU buffers; SMT vulnerable
  Meltdown:              Mitigation; PTI
  Mmio stale data:       Mitigation; Clear CPU buffers; SMT vulnerable
  Retbleed:              Mitigation; IBRS
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; IBRS, IBPB conditional, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
  Srbds:                 Mitigation; Microcode
  Tsx async abort:       Not affected

Do let me know if there's anything else you need me to test/verify.

Regards,
James.
Comment 3 James 2023-11-22 16:51:28 UTC
Dear David,

Just to update that I've been running your "Remove GBE LTR ignore" patch on my Intel NUC 8i3BEH for a whole week and all has been stable.

Tested-by: James Hutchinson <jahutchinson99@googlemail.com>
Comment 4 The Linux kernel's regression tracker (Thorsten Leemhuis) 2023-12-06 12:00:25 UTC
(In reply to James from comment #3)
> Dear David,
> 
> Just to update that I've been running your "Remove GBE LTR ignore" patch on
> my Intel NUC 8i3BEH for a whole week and all has been stable.

This looks stalled. Or did a fix for this make progress somewhere and I just missed that?
Comment 5 David Box 2023-12-07 03:36:33 UTC
(In reply to The Linux kernel's regression tracker (Thorsten Leemhuis) from comment #4)
> (In reply to James from comment #3)
> > Dear David,
> > 
> > Just to update that I've been running your "Remove GBE LTR ignore" patch on
> > my Intel NUC 8i3BEH for a whole week and all has been stable.
> 
> This looks stalled. Or did a fix for this make progress somewhere and I just
> missed that?

Fix will be posted shortly.