Touchpad not working on Random Boots

Hi there
Please don’t mark this as duplicate as I already searched the forum for a similar problem and couldn’t find one.
I’ve been using manjaro for a month now, and I encounter a wierd problem on random boots. The touchpad doesn’t work at all and the system doesn’t go to sleep when I press the sleep button.
This doesn’t happen in the sessions when the touchpad is working fine, it goes to sleep as soon as I press it.

Output of /etc/X11/xorg.conf.d/30-touchpad.conf when the touchpad IS NOT working

Section “InputClass”
Identifier “touchpad”
Driver “libinput”
MatchIsTouchpad “on”
Option “Tapping” “on”
EndSection

Output of xinput list when touchpad IS NOT working

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Acer Wireless Radio Control id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Sleep Button id=10 [slave keyboard (3)]
↳ VGA WebCam: VGA WebCam id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=13 [slave keyboard (3)]
↳ Acer WMI hotkeys id=14 [slave keyboard (3)]

NOTE: Logitech is my external mouse

Output of xinput list when the touchpad IS working:

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB-PS/2 Optical Mouse id=12 [slave pointer (2)]
⎜ ↳ ELAN0504:01 04F3:3091 Mouse id=13 [slave pointer (2)]
⎜ ↳ ELAN0504:01 04F3:3091 Touchpad id=14 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Acer Wireless Radio Control id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ Video Bus id=8 [slave keyboard (3)]
↳ Power Button id=9 [slave keyboard (3)]
↳ Sleep Button id=10 [slave keyboard (3)]
↳ VGA WebCam: VGA WebCam id=11 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=15 [slave keyboard (3)]
↳ Acer WMI hotkeys id=16 [slave keyboard (3)]

I’m using 5.10.42-1-MANJARO KDE Plasma plasmashell 5.21.5 and AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx
TIA

dmesg | grep -i elan output when touchpad IS working

[ 7.430376] i2c_hid i2c-ELAN0504:01: supply vdd not found, using dummy regulator
[ 7.430453] i2c_hid i2c-ELAN0504:01: supply vddl not found, using dummy regulato
r
[ 7.582101] input: ELAN0504:01 04F3:3091 Mouse as /devices/platform/AMDI0010:01/
i2c-0/i2c-ELAN0504:01/0018:04F3:3091.0002/input/input9
[ 7.582204] input: ELAN0504:01 04F3:3091 Touchpad as /devices/platform/AMDI0010:
01/i2c-0/i2c-ELAN0504:01/0018:04F3:3091.0002/input/input11
[ 7.582309] hid-generic 0018:04F3:3091.0002: input,hidraw1: I2C HID v1.00 Mouse
[ELAN0504:01 04F3:3091] on i2c-ELAN0504:01
[ 8.322301] input: ELAN0504:01 04F3:3091 Mouse as /devices/platform/AMDI0010:01/
i2c-0/i2c-ELAN0504:01/0018:04F3:3091.0002/input/input13
[ 8.322397] input: ELAN0504:01 04F3:3091 Touchpad as /devices/platform/AMDI0010:
01/i2c-0/i2c-ELAN0504:01/0018:04F3:3091.0002/input/input15
[ 8.322503] hid-multitouch 0018:04F3:3091.0002: input,hidraw1: I2C HID v1.00 Mou
se [ELAN0504:01 04F3:3091] on i2c-ELAN0504:01

dmesg | grep -i elan output when touchpad IS NOT working

[ 8.317427] i2c_hid i2c-ELAN0504:01: HID over i2c has not been provided an Int IRQ
[ 8.317503] i2c_hid: probe of i2c-ELAN0504:01 failed with error -22

Please show xinput list both when it works and when it doesn’t. At least you should be able to see what your touchpad id is and look for them in the kernel’s bugtracker as hardware problems are almost always kernel problem. If you can’t find one, feel free to report. Let the devs figure it out.

Thank you for replying.
I had to reboot to make the touchpad work, and I have attached the output of xinput list while the touchpad was working (and sleep functionality also working fine). I will add the output again when it is not working (as I said it happens randomly).
BTW, the command xinput wasn’t installed by default, I had to install it.

I’ve added both the outputs to the post.

OK, clearly when it doesn’t work it’s not registered to xinput.
Now that we know the model, do the same as above, but now replace the xinput list with dmesg | grep -i elan.

Same here, it’s been around for a long time.
I don’t use a mouse, only a touchpad.

The problem occours very often (but randomly) with kernel 5.10; very rarely with kernel 5.4.

For me, this workaround works:
sudo modprobe -r psmouse
sudo modprobe psmouse

(My Lenovo Thinkpad has a button called “Trackpoint”, so I can move the cursor and open a Terminal even if the touchpad doesn’t work).

Or in the [KDE] System Settings → Shortctus → Touchpad panel, you can set the keyboard shortcuts for “Disable Touchpad” and “Enable Touchpad” items.

It won’t be gone if you never reported it and the devs don’t fix it. Here’s an example of my own case that gets proper fix, I don’t need workaround anymore.

Oh!!
Yeah I do get the issue with touchpad can fixed with these workarounds, but what about the sleep thing then. Why does that only happen when the touchpad is not working.
This suggests that something is wrong and it’s not just about the touchpad.

Added the two outputs!!

My laptop too doesn’t go to sleep when I press the keyboard button.
But if I choose “Sleep” from the “Power/Session” start menu, it does.

For the moment, since I have very little free time to follow the issue, I am happy to stay on the 5.4 kernel and, at the most, use the two shortcuts I have set to reset the touchpad.

Thanks for the suggestions!!
I will downgrade to 5.4 if things don’t get better. Also even the touchpad shortcut don’t work for me when it is not registered in xinput.

I never had this before, so it seems a different problem than my report above. However, googling this message shows similar problem on some other laptops with different touchpad id (but still from our beloved ELAN brand): https://bugzilla.kernel.org/show_bug.cgi?id=209413

The final comment says it’s fixed in more recent kernel version, so you might want to UPGRADE instead of downgrade. Try 5.12 maybe? Otherwise, there’s a workaround by using some modprobe options there as well. If newer kernel doesn’t fix it, please report.

Yes I will do as you suggested.
Thank you for all your replies. I am an absolute noob, so now I at least know a place to search for bugs!! Thanks a lot