I have been following the topic and seeing the direction wanted to point out that in my testing this is not a Linux issue.
BIOS 3.07
Both Fedora 35 (5.17.4-200, gnome 41.5) and Windows 10 21H2 show the same behaviour when moving the mouse. This is both with the touchpad and a USB optical mouse.
I have also had the chance to test a second input cover (rattling touchpad) and saw very similar interrupts to the original.
This is good to hear, so maybe Framework can take a look at this problem now. I had an interesting bug happen the other day, I had accidentally turned on caps-lock, and I went to turn it off and while pressing it and the A key accidentally, my right forearm clicked the touchpad. At that point the A key began infinite repeat, and both the touchpad and the keyboard were offline. I was forced to hold the power key down for about 30 seconds to reboot the machine to rectify this. I was not able to reproduce it later. Just something of note.
As mentioned previously in the thread, the large number of interrupts generated are probably from the i2c controller on the SOC, as each physical interrupt requires the CPU to transfer multiple bytes. A more optimized Linux kernel driver may be able to fix this.
I think I understand the issue now. The touchpad is generating 140 hardware interrupts/second. This is separate from i2c. The Linux kernel is then receiving those interrupts either over i2c/i8042. Due to how the drivers are written the kernel is causing more interrupts then it is receiving. ~14 interrupts per hardware interrupts for the i2c driver and ~3 per hardware interrupt for i8042. I misunderstood and thought we were supposed to be expecting 140 interrupts/sec on i2c.
Next steps would be to debug the i2c drivers and see why it is generating so many interrupts from each hardware interrupts? @Kieran_Levin
A more optimized Linux kernel driver may be able to fix this.
I see the same occurrence with similar power deltas under Windows 10 unless I’m mistaken this indicates this is not a Linux related issue but a fact of the hardware?
Edit: Testing more I saw slightly lower power usage from Windows.
Moving the cursor used up to 2.8W over idle on Windows, 3.1W on Fedora 35. Just touching the touchpad used 1.5W over idle on Windows while Fedora showed 2.2W.
It makes sense that touching it immediately spikes the power usage; even if the input itself doesn’t result in a program responding, the act of touching the touchpad sensor is enough to generate interrupts that wake the CPU up and make it process them (i.e. use power).
I think a more reasonable comparison would be dragging your finger around for a minute or so on each OS and comparing the power usage then.
Hey thanks for the feedback! I agree this seems to be from processing the interrupts rather than the touchpad itself.
One problem I had was to keep motion consistent between tests this is why I went for resting a finger on the touchpad and peak power draw from moving. I think you are right however measuring total consumption rather than rate would be better.
To clarify “just touching” is me resting a finger on the touchpad and the additional power draws mentioned above are constant rather than just spikes.
I did some further testing only in Windows to remove Linux variables.
When using the touchpad vs an optical USB mouse the touchpad is on average using 0.9 watts more doing the same task.
I considered doing a total consumption comparison but the duration needed to get some reasonable numbers would be longer than is physically comfortable.
Just an observation …
I disabled 3 cpu cores in the bios and noticed that as a result powertop now only shows roughly 25% of the wake up counts when using the touchpad.
I was curious to see if this was an issue with 12th gen as well. On Arch running Linux 6.0.7-arch1-1, I get the following on my system between doing nothing and holding my finger on the touchpad measuring with turbostat:
So, maybe someone with a Ryzen 6000 laptop can chime, but with my curiousity piqued, I also decided to test with my old 4800H PF5NU1G (running the same 6.0.7-arch1-1 kernel):
I noticed the increase in CPU pakage power is substantially different to the increase in total system draw however the psys power domain (which also adds the PCH and eDRAM consumption AFAIK) is much more reflective of the change. Perhaps this is more about the PCH than CPU package?
Not a framework laptop, but Googling led me here as I am having this issue in Arch on a Dell G5 with an i7-10750H cpu. Same symptoms as above, verified with turbostat. ~1.25w idle and ~2w just moving the mouse. ~1.5w just touching the touchpad…
Edit: Can confirm that I get better battery life and lower powertop system usage on both Fedora and NixOS compared to Arch on this specific laptop… So unfortunately I’ll have to use something other than Arch on this laptop for now
in Arch ~13-15 idle - 16-20w browsing the web (even a live ISO)
in Fedora or NixOS ~7.5w idle and 10-13w browsing the web so the difference is significant.
I think i have part of the reason why this is happening. I looked at this using fedora 37, and it seems the gpio interrupt is pinned to one core, and the i2c interrupts are pinned to a separate core. This means every time the touchpad fires an interrupt, both a high performance and efficiency core cluster have to wake up to service the touchpad! And these are probably not even in the same cluster, so lots of cache evictions etc might be happening as both core clusters power on and off and caches are cleared and filled.
What core type are TP interrupts handled by?
The second idea was to investigate what core the interrupts are handled by:
First you can look at the Cores on the system to map them to E or P cores. The E cores will have lower frequencies when looked at using:
lscpu --all --extended
The second thing was to find out what cores the interrupts were handled by:
And move the touchpad, you will see which core the touchpad interrupts are increasing on both.
However the PIXA GPIO interrupt is pinned to a high performance core, but the i2c-designware interrupt is pinned to an efficiency core.