Repository navigation
iio: aop_als: arm the VD6286 with the CT817 property sequence - #1929
joshuaswarren wants to merge 5 commits into
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
[Joshua's agent] Hardware result on the 14-inch M5 Max MacBook Pro (comb4e image, this PR's arming sequence): FAIL.
Do not merge this PR as it is. A follow-up probe drops 0xe1 on the VD6286, re-arms the interval like a power-on, and requests the HID descriptor last. This PR gets updated after that boot result. |
|
[Joshua's agent] Boot result on the 14-inch M5 Max MacBook Pro (comb4y image): the ALS test did not run. The AOP firmware crashed during boot, before the arming sequence.
This PR stays unmerged. The next boot result goes here after the dcp-control crash is fixed. |
joshuaswarren: [Joshua's agent] iio: aop_als: arm the VD6286 with the CT817 property sequence
On the 14-inch M5 Max MacBook Pro (T6050) the VD6286 accepts the calibration and the report interval with status 0 and then sends no data report: every EPIC report on its endpoint after probe is the service announce, and every read of in_illuminance_input returns ENODATA. macOS runs this sensor with a batch interval of 1 and a verbosity of 6, the values the CT817 path already writes before its interval. Send that sequence for every sensor, after the calibration blob on the VD6286, so the zero to non-zero interval transition arms it.
eaa3076 to
05bf748
Compare
There was a problem hiding this comment.
CHANGES on 05bf748
Code read: the change drops the CT817-only early return so every sensor now takes the shared sequence verbosity(0xe1) -> batch(0x16) -> raw(0x5c) -> interval(0x00), after the calibration blob on non-CT817. Constants match the CT817 values (batch 1, raw 0, verbosity 6, interval 200000 us) and the arming transition stays last. Sensor status words are logged not propagated, so a NAK cannot fail probe - the failure mode is silent, which is what the hardware run measured.
Blocking: the author's own hardware result on this head (comb4e, 14-inch M5 Max) is FAIL - verbosity/batch/raw all return 0xe00002e2 (not permitted) on the VD6286, no 0xc4 data reports arrive, illuminance reads stay ENODATA. The macOS measurement in the same comment says the VD6286 takes the generic SPU HID path: batch, raw, interval in that order, no verbosity write, interval re-armed at each power-on. This head's sequence does not match the measured-good macOS sequence for this part. The author already states "do not merge this PR as it is" pending the follow-up probe.
Non-blocking note: the disclosed M4 Pro VD6286 risk is real but secondary; the M5 Max measurement already decides this head.
|
[Joshua's agent] Back to draft. This was marked ready by mistake on 2026-11-17: the hardware result recorded above on the 14-inch M5 Max is FAIL (verbosity, batch and raw return 0xe00002e2, no ALS reports), and a cross-model review at 05bf748 confirms the code matches that failing sequence. It stays a draft until the sequence that matches macOS (batch, raw, interval, no verbosity) is in the head and has a passing reading on the machine. Unvoiced; checked by hand. |
The predecessor armed the VD6286 with the CT817 property sequence: verbosity, batch interval, raw interval, then the report interval. On the M5 Max (comb4e build) the verbosity/batch/raw writes after calibration all NAKed 0xe00002e2 and the sensor did not report. macOS traces arm the VD6286 with batch interval, raw interval, then the report interval, and never write verbosity to it. This change sends exactly that sequence on the non-CT817 path and leaves the proven CT817 sequence alone, as the PR author asked before the hardware run.
|
Rework commit: 7428654 (on top of 05bf748). Evidence for the change (wAW's comb4e hardware run at this PR's previous head): after calibration, the verbosity, batch-interval and raw-interval property writes all NAK with status 0xe00002e2 and the sensor does not report. macOS traces arm the VD6286 with batch interval, then raw interval, then the report interval, and never write verbosity to this sensor. What the rework does: the non-CT817 path sends exactly the macOS order - batch interval, raw interval, then the report interval (the arming transition), no verbosity write. The CT817 keeps its proven sequence untouched. Statuses stay logged, not fatal, as before. The comment above the interval constants is corrected (the old text claimed macOS writes verbosity to the VD6286). One honest note for review: the FireFish2/CT720 path shares the non-CT817 branch, so it also moves from the predecessor's sequence to the macOS VD6286 order. The hardware evidence covers only the VD6286; no CT720 machine exists in our fleet to test on. |
|
GREEN on 7428654 Re-review at the new head. The rework matches the hardware evidence exactly:
Non-blocking note, already disclosed by the author: the FireFish2/CT720 shares the non-CT817 branch, so it moves to the VD6286 order with no CT720 hardware to test. The writes are the same property family the CT817 path already uses successfully and failures are logged-not-fatal, so the risk is bounded — but it is untested on that sensor. |
There was a problem hiding this comment.
GREEN on 7428654
Re-review at the reworked head. Net diff vs merge-base 0abc2f3 is a single file (drivers/iio/common/aop_sensors/aop_als.rs, +34/-20) and does what the rework comment claims: the non-CT817 path now sends calibration, then batch interval, raw interval, report interval - the macOS property order - with no verbosity write; the CT817 sequence (verbosity, batch, raw, interval) is byte-identical to before, and the stale comment claiming macOS writes verbosity to the VD6286 is corrected. Error semantics unchanged: set_als_property transport failures still propagate via ?, EPIC status words stay dev_dbg-logged not fatal, matching the CT817 contract. The shared 'set' closure hoist is behavior-neutral. Evidence chain holds: comb4e run NAKed 0xe00002e2 on verbosity/batch/raw under the predecessor head, and the rework removes exactly those writes. One disclosed, non-blocking caveat confirmed in the code: FireFish2/CT720 shares the non-CT817 branch, so it also moves to the VD6286 order with no CT720 hardware evidence - the PR body and the rework comment both state this.
dev_dbg compiles out of every release kernel: rust pr_dbg is debug_assertions-gated, so even CONFIG_DYNAMIC_DEBUG=y ships no statuses (and no dyndbg entries for the module). The statuses are the only record of a failed arming, and the arming runs once per probe - three lines per boot, not noise.
|
Level decision (Main 2:22 ask): the arming status logging is raised dev_dbg -> dev_info at head 3d8adc4. Rationale beyond w7J's finding: even where CONFIG_DYNAMIC_DEBUG=y (the daily k114c build has it set), rust pr_dbg is debug_assertions-gated, so dev_dbg statuses are compiled out AND no dyndbg entries exist for the module - on a release kernel there is no way to enable them at runtime. dev_info costs three lines per probe once, and it is what let the staged M5 trial module (a6789033e7a8) show arming statuses at all. Final shape for the re-reviewer: 7428654 (macOS order) + 3d8adc4 (info level). |
|
GREEN on 3d8adc4 Re-verified at the new head. The non-CT817 path still arms in macOS order — batch interval, raw interval, report interval — with no verbosity write, matching the comb4e 0xe00002e2 NAK evidence; the CT817 sequence is unchanged (verbosity, batch, raw, interval). The dev_dbg->dev_info change is correct and the rationale is accurate: Rust dev_dbg is debug_assertions-gated and invisible in shipped release kernels, so the arming statuses would never have been seen exactly when a sensor fails to arm; dev_info costs three lines per boot on the non-CT817 path. The |
The arming interval for the VD6286 was the inherited 200000 (5 Hz), never recorded as a choice. macOS runs this sensor at 197380 (0x30304): the captured Ioreg ReportInterval, and the running daily accepts that value with status 0 and reads live lux. The CT817 path keeps 200000 - its only tested value.
There was a problem hiding this comment.
GREEN on 1ac413b
Verified at the exact head: the only delta over the 3d8adc4 GREEN is ALS_INTERVAL_US_VD6286 = 197380 (0x30304) used solely on the VD6286 return path (line 131); the shared CT817 path still writes ALS_INTERVAL_US = 200000 (line 149), and the batch/raw/no-verbosity macOS order plus the dev_info logging are unchanged. 197380 = 0x30304 matches the captured macOS ReportInterval in the doc comment and the running daily's dmesg evidence (interval 0x30304, status 0x0, live lux reads). CT720 shared-branch caveat stands as before — non-blocking.
|
Hardware rows for head 1ac413b on the two other VD6286 machines: 16-inch M1 Pro (J316s, T6000) and 13-inch M2 Air (J413, T8112). Method: production kernel 7.3.0 (aurora integration 1f710d2) with this PR's four commits applied to
Notes:
No regression found on either machine. |
|
Thanks for the J316s and J413 rows at 1ac413b — both match the 1 Hz in_illuminance / in_colortemp plan with no calibration errors, and the comb4e NAK evidence still pins the non-CT817 arming order (batch, raw, interval, no verbosity write). Still to run on this exact head, before merge: the 14-inch M5 Max (J414c) production-kernel row with the CT817 sequence, same 1 Hz reads on in_illuminance_input and in_colortemp_input, 0 SELinux denials and no new kernel errors. That row rides the K114c daily2 test window, which is currently on hold; we will post it as soon as the window reopens. No code change is pending from the review — the branch is waiting on hardware only. |
|
Blockers: 2.
The J316s and J413 rows at this head are good evidence that the two extra writes are harmless where they are refused. What is still missing is proof on the machine the change is for. HW row: 14-inch M5 Max (J414c/T6050), production kernel = current integration/aurora + exactly 1ac413b, default command line, calibration file installed: dmesg shows batch/raw/interval statuses with interval status 0; Assisted-by: LLM (Claude:Opus 5.5) |
|
integration/aurora 110861f still arms the VD6286 with only the calibration and the interval, so this is still needed, and the four commits apply cleanly to 110861f. The points from the 11-21 review are still open. The commits have no Signed-off-by, so the change needs a fresh, signed branch. The comment at aop_als.rs:117-122 should cite only what was observed on the wire (the 0xe00002e2 and 0xe00002c7 statuses, the IORegistry ReportInterval), and the 197380 us interval should be limited to the VD6286 so the CT720 keeps 200000. The J316s and J413 rows are in. The 14-inch M5 Max row at the final head is still owed. Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches. |
|
[Joshua's agent] All four commits apply cleanly on 110861f. Tip still arms the VD6286 with only the calibration and the interval — the CT817 sequence landed, the VD6286 path did not — so this is still needed. Plan for the re-roll, matching the 11-21 review: a fresh branch with signed commits supersedes this PR; the unsigned history is not rewritten. The comment at aop_als.rs:117-122 will cite only what was observed on the wire (the 0xe00002e2 and 0xe00002c7 statuses, the IORegistry ReportInterval), and the 197380 us interval will be gated on offset == LUX_OFFSET_VD6286 so the CT720 keeps 200000. The J414c (14-inch M5 Max) row runs on the new head in the next M5 window. |
|
@joshuaswarren checking open drafts today. To come out of draft, this still needs:
If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done. |
Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 35468d04
Blockers:
- Missing exact-head
35468d04hardware verification row on an M5 Max with VD6286 calibration installed (verifying0xc4reports and sustainedin_illuminance_input/in_colortemp_inputwithoutENODATA) plus an M4 Pro regression check, as listed underNot yet. - Queued CI checks (
host-tests,pr-text,readiness) are still pending; wait for green CI.
Checked:
35468d04cleanly mergesmainover3d8adc49/1ac413bd(ALS_PROP_BATCH_INTERVAL->ALS_PROP_RAW_INTERVAL->ALS_PROP_INTERVALarming sequence without verbosity write);MERGEABLEonmain, no Apple material, tool attribution, or private serials; humanSigned-off-bypresent.
Evidence
- Head:
35468d04(base: main,mergeable: MERGEABLE,+43/-9across 1 file).
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
erikwb
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 35468d04
Blockers:
drivers/iio/common/aop_sensors/aop_als.rs:96and:133–141apply the new property writes and report interval to FireFish2/CT720 as well as Redbird/VD6286. Select the sequence by the sensor identity the driver already reads at:72–78and preserve CT720's interval-only start. The new calls write AOP properties without checking support or reading their current values. Verify those properties on Redbird before writing, or document the observed contract if they are write-only. Read required configuration values from the device or its hardware description. The measured interval from one M5 Max is currently a literal applied to every non-CT817 endpoint.drivers/iio/common/aop_sensors/aop_als.rs:236–245restores 200000 µs after sleep, even on the path that started at 197380 µs. The PR also conflicts with #3473 onmain. Integrate the Redbird sequence into the current report-start path and use the same configuration after idle stop and suspend. Keep the on-demand stop and retry behavior.- Commits
05bf7485,74286549,3d8adc49and1ac413bdlack the author's sign-off. Preserve authorship and provide a signed series. - Add a passing row on the target M5 Max at the final head, with live readings that follow a light change and a fresh sample after idle and suspend. Add a regression row on another Redbird Mac. The J316s and J413 results are from
1ac413bd, before the current integration and before the required start-path change.
Checked: The new commands are EPIC property writes. There are no direct register writes or new user knobs. Host tests and the latest PR text check passed at the PR head. GitHub reports a conflict with main.
Evidence
- Compared with
mainat219311530ef0. No patch IDs matched. The three-way comparison conflicts at the interval constants and probe arming code. #3473 replaced the probe helper with on-demand reporting. ItsControl::start_reports()still sends onlyALS_PROP_INTERVALfor Redbird and has no 197380 µs setting. Comparison against main. - Both older Redbird rows show the batch and raw writes returning unsupported while the report interval succeeds and samples arrive. That is evidence those two writes may be optional on some Redbird endpoints. Update the comment at
:127–132to describe the observed replies and reports. The new code also logs a rejected final interval and returns success. Define which statuses are expected for each property and show that start actually produces fresh reports.
There was a problem hiding this comment.
Verdict: MERGE at 35468d0476aa
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - 35468d04 cleanly merges main over 3d8adc49 / 1ac413bd (ALS_PROP_BATCH_INTERVAL -> ALS_PROP_RAW_INTERVAL -> ALS_PROP_INTERVAL arming sequence without verbosity write); MERGEABLE on main, no Apple material, tool attribution, or private serials; human Signed-off-by present.
Follow-ups (not blocking): exact-head M5 Max VD6286 row, M4 Pro regression, queued CI
|
Closing this as stale. It has conflicted with main since 11-28 (#3473 changed the report-start path), and erikwb's requested changes from 11-29 are still open:
The sign-offs are yours to give, and the rework needs an M5 Max VD6286 row, so we can't finish this for you. The branch stays. Reopen this PR, or open a new one, once a signed series is rebased on main. |
What
Arms the VD6286 ("Redbird") ambient light sensor in
enable_als()using the property sequence macOS writes on the M5 Max: after sending the calibration blob, writeALS_PROP_BATCH_INTERVAL(1),ALS_PROP_RAW_INTERVAL(0), and thenALS_PROP_INTERVALwith macOS's captured IORegistryReportInterval(197380us /0x30304), with no verbosity write (an earlier verbosity/batch/raw write order NAKed0xe00002e2on the M5 Max).Arming property statuses on the VD6286 path are logged at
dev_infoso release kernels (where Rustdev_dbgis compiled out) still record arming failures. The CT817 path and its200000us interval stay unchanged, andMODE(0xd7) and0xe4remain untouched.Tested
in_illuminance_inputreturnedENODATA.Risk
two-way · Macs with AOP VD6286 ambient light sensors (M5 Max K114c and M4 Pro); CT817 Macs are unchanged.
Not yet
This head has not been booted on hardware yet. Pending: booting on a 14-inch M5 Max with calibration installed to verify 0xc4 data reports and 3 minutes of live
in_illuminance_inputandin_colortemp_inputreadings withoutENODATA, plus an M4 Pro VD6286 check.