Skip to content

iptsd: start it for the Surface Laptop 7 touchpad when the boot-time start is lost - #2798

Merged
ryanrhughes merged 3 commits into
omacom:masterfrom
fidecastro:iptsd-romulus15-boot-retry
Nov 15, 2026
Merged

ryanrhughes merged 3 commits into
omacom:masterfrom
fidecastro:iptsd-romulus15-boot-retry

Conversation

@fidecastro

@fidecastro fidecastro commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does: on the Surface Laptop 7 15", iptsd sometimes never starts for the touchpad at boot, and the pad is then a one-finger mouse until the next boot. This adds a small service to the iptsd package that starts it once the pad is ready. It does nothing on any other machine.

This is a draft on purpose. It is a workaround, and whoever knows iptsd's udev rule may prefer to fix the cause there instead; see "A better fix?" below.

What goes wrong

On 3 of 7 boots of my laptop:

  1. The touchpad's HID device binds to hid-generic, and iptsd's udev rule starts iptsd@dev-hidrawN.service.
  2. About 200 ms later the device is re-bound to hid-multitouch. The hidraw node goes away and iptsd is stopped.
  3. In the same millisecond the kernel logs spi_hid_of spi0.0: failed to set report six times, then Response timed out once a second for about five seconds.
  4. The rule runs again for the new hidraw node, iptsd-check-device gets no answer from the pad, and SYSTEMD_WANTS is not set. Nothing asks for iptsd again.

On the other boots, step 2 is followed 25 ms later by a clean start. My reading, not proven, is that iptsd is cut off mid-conversation with the pad, which leaves the pad silent for those five seconds.

Two things that don't recover it:

  • systemctl start iptsd@dev-hidrawN.service starts and stops within 2 ms: the unit has StopWhenUnneeded=yes and nothing wants it.
  • iptsd-romulus15-resume.service runs systemctl restart iptsd@*.service, which only restarts units that exist.

What does: udevadm trigger --action=change /dev/hidrawN, once the pad answers again.

What changes

  • iptsd-romulus15-boot (to /usr/lib/iptsd/): every 5 seconds for up to 40, it finds the touchpad's hidraw node (045E:0C77), checks whether its iptsd unit is active, and re-runs the udev rule for that node if not.
  • iptsd-romulus15-boot.service: a oneshot wanted by multi-user.target, with ConditionFirmware=device-tree-compatible(microsoft,romulus15) like the resume service.
  • pkgrel 3 to 4, a paragraph in README.package.md, and three checks in test.sh.

Tested

On my own Surface Laptop 7 15", kernel 7.3.0-62-omarchy, iptsd 3.1.0-3, with the same script and an equivalent unit installed by hand under /usr/local/bin and /etc/systemd/system (the lines from touchpad_id down are identical to the packaged script):

  • First boot with it, the failure happened: the service logged "iptsd is not running for the touchpad (hidraw5); re-running its udev rule (attempt 1)" and, five seconds later, "iptsd is running for the touchpad (hidraw5) after 1 retries". Gestures worked without my doing anything.
  • Second and third boots, no failure: "iptsd is running for the touchpad (hidraw5) after 0 retries".
  • bash pkgbuilds/iptsd/test.sh passes, and the checksums of the four local sources match.

Not tested

  • The package itself: I have not built it with bin/build or installed it, so the /usr/lib/iptsd path and the multi-user.target.wants link are unexercised.
  • More than three boots, and any machine but mine.
  • With linux-omarchy-dtbs: give the Surface Laptop 7 15" its touchscreen #2793 the laptop also has a touchscreen on a second iptsd instance. This script looks only at the touchpad. The touchscreen's instance started by itself on both boots I have with it.

A better fix?

The service treats a symptom. If the cause is the udev rule starting iptsd on the hid-generic binding only to have it stopped by the re-bind, a rule that waits for the final driver, or an iptsd-check-device that retries, would remove the race. I don't know iptsd well enough to say which is right, and I'm glad to test either on this hardware.

Related

Written with Claude Fable 5.2. I ran every command and test on my own laptop.

…start is lost

On some boots the touchpad stops answering just as its HID device is
re-bound, iptsd's udev rule finds it silent and iptsd is never started,
so the pad stays in its mouse mode. iptsd-romulus15-boot.service re-runs
the rule until iptsd is up. It does nothing on any other machine.
@birkskyum

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds a boot-time recovery service for the Surface Laptop 7 15" touchpad.

  • Boot retries can start iptsd for the Surface Laptop 7 touchpad.

Reviews (3) · Last reviewed commit: "iptsd: check once more after the last bo..." · Reviewed by Greptile

Comment thread pkgbuilds/iptsd/iptsd-romulus15-boot Resolved
A start the eighth re-run of the udev rule brings was still reported as a failure, leaving the service failed on a touchpad that works.
@birkskyum
birkskyum marked this pull request as ready for review November 15, 2026 17:26
@birkskyum birkskyum added the build-approved Maintainer approved this PR to build on the self-hosted pool label Nov 15, 2026
@ryanrhughes
ryanrhughes enabled auto-merge (squash) November 15, 2026 17:32
@ryanrhughes
ryanrhughes merged commit 77b9bce into omacom:master Nov 15, 2026
17 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Publish succeeded → live

Packages: iptsd (aarch64, PR artifact)

  • edge/aarch64: iptsd-3.1.0-4-aarch64

Commit 77b9bce · run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-approved Maintainer approved this PR to build on the self-hosted pool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants