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:
cat /proc/interrupts
watch -n 1 "cat /proc/interrupts | grep designware"
watch -n 1 "cat /proc/interrupts | grep PIXA"
CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 CPU8 CPU9 CPU10 CPU11 CPU12 CPU13 CPU14 CPU15 CPU16 CPU17 CPU18 CPU19
43: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 43694516 0 0 0 0 IR-IO-APIC 43-fasteoi i2c_designware.2, idma64.2
135: 0 0 1711105 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 intel-gpio 3 PIXA3854:00
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.
Lets pin them both to the same core CPU2:
# echo 00004 > /proc/irq/43/smp_affinity
# echo 00004 > /proc/irq/135/smp_affinity # DOESNT WORK, IO error?
Power consumption when using the touchpad seems to drop from about 7W to 5W! (Baseline is 4W)
I would like to pin the PIXA intel-gpio interrupt to an efficiency core, but I have not figured out how to do this.