Skip to content

iio: aop_motion: give each sensor its own trigger - #1038

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/aop-motion-trigger
Nov 6, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/aop-motion-trigger

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

iio-sensor-proxy finds a buffered IIO sensor through its trigger (<name>-dev<id> or <name>-trigger). The AOP accelerometer and gyroscope fill their buffers from AOP reports with no trigger. On the J616s, iio-sensor-proxy logs Could not find trigger name associated with .../accel.1.auto/iio:device2 every boot, and no trigger-based IIO client can use the buffer.

This registers a <name>-dev<id> trigger per device and makes it the default, the way the HID sensor hub drivers do. The buffer becomes a triggered buffer. Its poll function stamps the time and its threaded half only completes the trigger; the IRQ core warns about a oneshot poll function without one. The report listener keeps pushing the scans, and the trigger never fires. validate_trigger = iio_validate_own_trigger refuses other triggers.

It adds the IIO trigger headers to the Rust bindings and a helper for the inline iio_trigger_get(). Kconfig now selects IIO_TRIGGERED_BUFFER.

Hardware test, J616s (7.3.0-aurora-motion1 = fleet17 2661d71 + these commits, tree identical to this branch; one-shot boot, fleet17 default untouched and restored after):

  • Triggers aop-sensors-accel-dev1 and aop-sensors-gyro-devN exist and are the defaults. iio-sensor-proxy finds the accelerometer through its trigger and enables its buffer, and the Could not find trigger name warning is gone. It then ignores the accelerometer by design, because the device labels itself accel-base; that's its policy for laptop-base accelerometers, so the display does not rotate.
  • Buffered reads through the trigger: accelerometer 51 samples/s, gyroscope 50–51 samples/s, sane values. A foreign trigger is refused with EINVAL.
  • No kernel WARNING/Call trace. SELinux enforcing, 0 AVC, journalctl -b -p err empty.
  • Warnings vs the fleet17 boot on the same Mac: only the trigger warning (and unrelated one-offs) gone; nothing new from the kernel.
  • The first boot of the first version showed WARN_ON_ONCE(IRQF_ONESHOT && !thread_fn) when a buffer was enabled; the second commit fixes it, and the re-test above is with it.
  • No build warnings from the changed files.

🤖 Generated with Claude Code

iio-sensor-proxy finds a buffered sensor through its trigger: it looks
for "<name>-dev<id>" or "<name>-trigger", and without one it logs
"Could not find trigger name associated with ..." and does not offer the
sensor at all. The AOP accelerometer and gyroscope fill their buffers as
the AOP reports, with no trigger, so on the J616s the accelerometer was
missing from iio-sensor-proxy (HasAccelerometer false) and every boot
logged that warning.

Register a "<name>-dev<id>" trigger per device and make it the default,
the way the HID sensor hub drivers do: the buffer is a triggered buffer
whose poll function only stamps the time, and the report listener keeps
pushing the scans. The trigger never fires. Only the device's own
trigger is accepted.

Add the IIO trigger headers to the Rust bindings and a helper for the
inline iio_trigger_get().

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Enabling a motion buffer hit WARN_ON_ONCE(IRQF_ONESHOT && !thread_fn)
in __setup_irq(): the triggered buffer requests its poll function as a
oneshot interrupt, and this one only had the time-stamping top half.
Add a threaded half that completes the trigger. The trigger never fires,
so it never runs.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant