Skip to content

iio: aop_als: stop the reports for a system sleep and on unbind - #1876

Draft
gig3m wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
gig3m:j813/aop-als-sleep
Draft

gig3m wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
gig3m:j813/aop-als-sleep

Conversation

@gig3m

@gig3m gig3m commented Nov 14, 2026

Copy link
Copy Markdown

The ALS reports on its own at the interval the driver sets at probe (200 ms), and each report is an AOP mailbox interrupt. Nothing set the interval back to zero, so:

  • after an unbind the sensor kept reporting to nobody
  • in suspend-to-idle it woke a CPU five times a second

This sets the interval to zero on unbind and in .suspend, and back in .resume.

Draft, because I can test one machine and this driver serves several. Feedback wanted on:

  • the CT817 (T8140). It starts on the zero to non-zero transition and wants its batch and raw interval written first. Resume writes only the interval. Is that enough there?
  • a real sleep. aop.rs stops the endpoints in suspend_late for a firmware sleep; this runs before that, in .suspend. I could only test s2idle.
  • whether macOS stops the ALS for a sleep the same way. I have no trace of it.

Tested on J813 (Mac17,3, 27.0 stub, VD6286), integration/aurora 5d112b1 merged with #1532:

  • awake, AOP mailbox interrupts per 10 s: bound 60, unbound 10 (59 before this change), rebound 60
  • s2idle test suspends, 20 trials: 1.15 to 1.2 interrupts per second in the sleep, 5.9 to 6.0 before
  • the channel reads again after every resume and rebind
  • one lid-close sleep, 181 s on battery: 1.02 interrupts per second in the sleep (it was 3.6 on an earlier kernel), the channel reads again after it, no warning
  • no measurable power change in s2idle here (1.90 W against 1.93 W, 20 s trials): the cores only clock-gate. It should count once T8142 has a real sleep.

Not tested: any other Mac, a failed interval write on resume (it now warns).

Assisted-by: Claude Fable 5.2

The sensor reports on its own at the interval the driver sets at probe,
and each report is an AOP mailbox interrupt. Nothing set the interval back
to zero: the sensor kept reporting after the driver was unbound, and
through suspend-to-idle, where it woke a CPU five times a second.

Set the interval to zero on unbind and on system suspend, and back on
resume.

Assisted-by: Claude Fable 5.2
Signed-off-by: Kyle Arrington <kyle@arrington.co>
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