Created attachment 304222 [details]
patch to reenable IRQ override for recent AMD cpus
I have an HP Pavilion Aero 13 laptop that comes with an AMD Ryzen 7735U CPU and an up-to-date BIOS. Using any kernel version that is strictly greater than 5.19.9 on it is causing the typing with the integrated keyboard to be extremely slow.
"Slow" is subjective but let's say that once you hit a key you have to wait a few seconds for it to be displayed. Everything else is very responsive, `top` doesn't show any abnormally high CPU usage, and the issue is really with the keyboard.
After some bisecting I found that 5.19.9 doesn't have this issue, but any version greater than or equal to 5.19.10 has it. Looking at the changelog of the 5.19.10 I noticed the 37c81d9f1d1b1458894454efcb857f6a769b6bc4 which disables IRQ overriding for AMD Ryzen CPUs.
I then wrote the following patch (see attached) which basically reverts that change (the culprit is really just the `#ifdef` below) and now after applying that patch with any kernel version up to the 6.3.0 my keyboard is responsive again.
Can you please test the patch attached to https://bugzilla.kernel.org/show_bug.cgi?id=217394 to see if this helps?
Also, can you please include an acpidump and dmesg for your system?
Apologies for the late answer. I'm including here the outputs of dmesg and acpidump for the kernel version 6.3.2 with and without the IRQ override patch that I had attached.
I haven't yet tested your patch, I'll recompile the kernel today with yours and will let you know when it's done.
Created attachment 304257 [details]
dmesg for 6.3.2 kernel without the IRQ override
Created attachment 304258 [details]
acpidump for 6.3.2 kernel without the IRQ override
Created attachment 304259 [details]
dmesg for 6.3.2 kernel with the IRQ override
Created attachment 304260 [details]
acpidump for 6.3.2 kernel with the IRQ override
@Mario: Applying your patch (and nothing else) on the 6.3.2 kernel also yields a responsive keyboard and solves the issue just like with my revert. Going to keep this kernel build as I suppose your patch is obviously the cleaner solution. I'll attach the dmesg and acpidump outputs for the 6.3.2 with your patch applied.
Created attachment 304261 [details]
dmesg for 6.3.2 kernel with Mario's patch
Created attachment 304262 [details]
acpidump for 6.3.2 kernel with Mario's patch
I've submitted https://email@example.com/T/#u for discussion on this issue.
Unfortunately the dropping of:
* IRQ override isn't needed on modern AMD Zen systems and
* this override breaks active low IRQs on AMD Ryzen 6000 and
* newer systems. Skip it.
As done in commit a9c4a912b7dc ("ACPI: resource: Remove "Zen" specific match and
quirks") is causing keyboard problems for quite a lot of AMD based laptop users using other models, see e.g. :
So I have submitted a revert upstream:
I did add an extra patch on top:
which should keep the behavior of a9c4a912b7dc for any laptop with a line like this in dmesg:
[ 0.021867] ACPI: INT_SRC_OVR (bus 0 bus_irq 1 global_irq 1 low edge)
Note the "bus_irq 1" is important here. There will also be other INT_SRC_OVR messages with a different bus_irq!
If possible please give this patch-series a try:
With this series there should still be a line like:
[ 0.410670] ACPI: IRQ 1 override to edge, low(!)
in dmesg for laptops which need the override (based on the INT_SRC_OVR bus_irq 1),
so this patch-series should not cause a regression on the laptop from the original reporter of this bug.