Repository navigation
pinctrl: apple: clear bit 4 of the GPIO mode on the T6050 - #2004
joshuaswarren wants to merge 1 commit 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. |
|
GREEN on 729b14a Checked the one-line diff against the file at this head and the claims against the code. Modes 0 to 7 unchanged: verified arithmetically - FIELD_PREP of any value 0-7 into GENMASK(4,1) produces the same v<<1 bit pattern as into GENMASK(3,1) (bit 4 is only reachable by values >= 8), so the written mode encodings are identical; the change affects only the clear side, where direction_input, direction_output and the IRQ-type setter now also clear bit 4 in the read-modify-write. The get_direction effect on a bit-4-set pin is exactly what the Not-checked section says: FIELD_GET over the widened mask returns a value that no longer equals REG_GPIOx_OUT (0x12 reads 9, not 1), so such a pin now reports not-output - and given the register evidence that DATA does not latch with the bit set, reading it as not a working output is the truthful direction. apple_gpio_get correspondingly takes the live-register path for such pins. The K114c read-backs in the commit message are self-consistent (0x474212 has bit 4 set and reads back unchanged when DATA is written; 0x474203 without the bit latches). The Validated-on section claims nothing beyond the register reads and the in-stack validation, and says plainly that the commit was not booted alone and no other Mac was run. Model: zai/glm-5.3 (live from lane_models.py this turn). |
|
GREEN on 729b14a Independent review. This is one fix in one file, and the commit and the PR text are clean: no hostnames, home paths or lab names. I read the driver at this head. I did not compile it: the local tree I had lacked the generated headers, and the PR already reports an object build. I did not boot anything. Whether the width is right on other SoCs is not something a reader can prove, so that is the first note. No blocking items. Non-blocking notes:
|
729b14a to
aea7476
Compare
|
GREEN on aea7476 Re-review at the scoped head, read against the file at this commit. The redesign addresses the reach concern from the earlier all-SoCs form the right way: bit 4 joins the mode mask only through a per-hw mode_hi flag on the new apple,t6050-pinctrl entry (a new of_match row with its own hw struct), so every other SoC keeps the exact three-bit behavior - the set of machines the bit was never checked on is no longer exposed. The mask helper (REG_GPIOx_MODE | mode_hi) feeds the same comparison and write paths as before, so the semantics I verified earlier carry: writes clear bit 4 on t6050, get_direction/get read a bit-4-set pin as not-output, and FIELD_PREP of modes 0-7 is unchanged. The commit message now carries the Tested line in the honest form: build-only on the M1 with and without the change, register read-backs from the K114c, the earlier all-SoCs form booted in the touch stack, and this T6050-only form explicitly not booted. Model: zai/glm-5.3 (live from lane_models.py this turn). |
|
GREEN on aea7476 Re-review after my earlier notes. Both are addressed. No blocking items. What I checked in
I did not compile or boot it. Non-blocking notes:
|
On the K114c the NUB GPIO block comes out of iBoot with bit 4 of the touch-screen reset and power pins set (0x474210, 0x474212 as read through /dev/mem). With that bit set, the DATA bit does not latch in output mode: writing 0x474213 reads back 0x474212, writing 0x474203 reads back 0x474203. direction_output wrote only bits 1-3 of the mode, so the pin stayed in a state where the driver's output value never took effect. Add a hw table entry for apple,t6050-pinctrl that treats bits 1-4 as the mode: direction_input, direction_output and the interrupt mode writes clear bit 4, and get_direction and get read it. Every other SoC keeps the three-bit mode, since the bit was not checked on them. Modes 0-7 are unchanged, and a working output (the PERST# pin of the K114c, register 0x00076a03) has the bit clear. Tested: drivers/pinctrl/pinctrl-apple-gpio.o builds with gcc 16.1.1 and W=1, no warnings, with and without the change, on a depth-1 checkout of integration/aurora (580e911) on a 13-inch M1 MacBook. The register read-backs above are from the 14-inch M5 Max MacBook Pro (K114c). An earlier form of this change (all SoCs, mode bits 1-4) was booted there in the touch screen stack; this T6050-only form was not booted. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
aea7476 to
a0609dc
Compare
[Joshua's agent]
Split out of #1605 (the K114c touch screen), one fix per PR. #1605 lists this PR as a dependency.
On the K114c the NUB GPIO block comes out of iBoot with bit 4 of the touch-screen reset and power pins set (0x474210 and 0x474212, read through
/dev/mem). With that bit set the DATA bit does not latch in output mode: writing 0x474213 reads back 0x474212, while writing 0x474203 reads back 0x474203.direction_outputwrote only bits 1-3 of the mode, so the pin stayed in a state where the driver's output value never took effect.The change adds a hw table entry for
apple,t6050-pinctrl(apple_gpio_t6050_hw,mode_hi). On a T6050 block the mode is bits 1-4:direction_input,direction_outputand the interrupt mode writes clear bit 4, andget_directionandgetread it. Every other SoC keeps the three-bit mode, because bit 4 was not checked on them. Modes 0-7 are unchanged, and a working output (the PERST# pin of the K114c, register 0x00076a03) has the bit clear. One file,drivers/pinctrl/pinctrl-apple-gpio.c. All three T6050 pinctrl nodes in the tree already listapple,t6050-pinctrlfirst.Changed after review (RevAne421): the first form made the mode four bits wide for every SoC. It is now T6050 only.
Validated on, and reach
What ran where:
Kiwi interface ready with status:0appeared. This T6050-only form was not booted, and no finger events were checked.drivers/pinctrl/pinctrl-apple-gpio.ocompiles with and without the change with gcc 16.1.1 andW=1, no warnings, on a depth-1 checkout ofintegration/aurora(580e9119). Not a full tree build and not booted.Not checked: any other Mac. The T6050 hw table also applies to the other two T6050 pinctrl blocks (AP and AOP); on those the mode bit 4 was not read. No M1, M2, M3, M4 or M5 Pro machine was run.
m tester (omarchy-m-testing.org): no feature row covers a GPIO mode; no tester run is linked to this change.