<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="shortcut icon" href="/favicon.ico"> <link rel="icon" type="image/png" href="/favicon.png" sizes="196x196"> <title>Workaround for broken TrackPoint</title> <style> * { box-sizing: border-box; overflow-wrap: break-word; word-wrap: break-word; /* legacy */ word-break: break-word; /* for WebKit/Chrome */ } main { max-width: 36rem; margin: 0 auto; } code, .email { font-family: monospace, monospace; } .asterism, footer { margin: 2rem 0; text-align: center; } pre { overflow-x: auto; background-color: #eee; border-radius: 5px; padding: 10px; } </style> </head> <body> <main> <p><a href="/">Index</a></p> <h1>Workaround for broken TrackPoint</h1> <small><time>2022-12-05</time></small> <p> Sometimes, seemingly at random after clicking the dedicated left click or right click buttons, the buttons and trackpoint on my Lenovo Thinkpad T14s stops working. Instead of clicking, the three mouse buttons just makes the pointer move a bit and the trackpoint makes the pointer move in a random direction and seems to issue clicks. </p> <p> When this happens, the kernel buffer is spammed with "<code>psmouse serio1: elantech: discarding packet</code>". Searching the interwebs, I found that more people seem to be experiencing similar weirdness with the elantech trackpoint driver. </p> <p> Rebooting the computer works, but it's annoying. Removing and re-adding the misbehaving kernel module resolves the issue too fortunately. I put the following in <code>~/bin/fixmouse</code>: <pre><code>#!/bin/sh doas rmmod psmouse doas modprobe psmouse </pre></code> So now I can run <code>fixmouse</code> whenever the driver stops working. </p> <hr> <p><i>Update 2023-09-24:</i> If the psmose module is builtin, it can't be unloaded, giving "<code>rmmod: ERROR: Module psmouse is builtin.</code>" Fortunately, there's a better way of reloading the trackpad using a method described in an <a href="https://lwn.net/Articles/143397/">article on LWN</a> from 2005. </p> <p>The error in the kernel buffer indicates that the trackpad is called <code>serio1</code>, but for posterity we can find devices using the <code>psmouse</code> driver with <code>find</code>: <pre><code>$ find /sys/bus -name psmouse /sys/bus/serio/drivers/psmouse $ ls -l /sys/bus/serio/drivers/psmouse total 0 --w-------. 1 root root 4096 Sep 23 22:19 bind -rw-r--r--. 1 root root 4096 Sep 23 22:19 bind_mode -r--r--r--. 1 root root 4096 Sep 23 22:19 description lrwxrwxrwx. 1 root root 0 Sep 24 10:42 serio1 -> ../../../../devices/platform/i8042/serio1 --w-------. 1 root root 4096 Sep 23 14:20 uevent --w-------. 1 root root 4096 Sep 24 10:36 unbind </pre></code> As described in the article, we can unbind the touchpad with (as root) <pre><code>echo -n "serio1" > /sys/bus/serio/drivers/psmouse/unbind</pre></code> My touchpad rebinds automatically after a few seconds, but you should be able to bind it manually using <code>[...]/psmouse/bind</code>. </main> <footer>❦</footer> </body> </html> <!-- vim: set tw=79 -->