Repository navigation
Conversation
|
Thanks, Nate. The callback is right as far as it goes: it reads the same CON field I can't take it as it is, because it changes more than the warning, on every phone that uses this driver:
What I'd like: set the callback only for the pin controllers that ask for it. A flag in There is no hurry on this one: the camera device tree that shares gpp10-2 isn't in a pull request yet, and the warning is harmless until then. If you'd rather send it with the camera series, that works for me. And when it goes to linux-samsung-soc, the gs101 question in point 1 is worth raising there yourself. |
derekross
left a comment
There was a problem hiding this comment.
CI has run on this head and passes: it merges cleanly onto today's omamobile, the sign-off, prefix and checkpatch --strict checks are clean, and pinctrl-samsung.c builds with W=1. The one skipped line is "device trees: none touched", which is right for this change. That is the same result I had locally; it covers the build, and the three points in my comment above are about what the callback does at probe on the other phones, so they stand as they are.
The Samsung GPIO chip has no get_direction() callback. gpiolib asks
for the direction of a line when a shared GPIO proxy registers its
chip and when a consumer requests a line through the proxy. It warns
at drivers/gpio/gpiolib.c:431 each time the callback is missing.
On the Pixel 9 Pro Fold, this produces three warnings at boot and one
more each time a driver takes gpp10-2, the reset GPIO shared by the
main camera and its lens actuator.
Read the function field of the bank's CON register, which
samsung_gpio_set_direction() writes. Report function 0x1 as GPIO
output and input or alternate functions as GPIO input.
Opt in through the zumapro pin controller data used by the Pixel 9
Pro Fold and the Pixel 9a, for the eight controllers zumapro.dtsi
describes (ALIVE, CUSTOM, FAR, HSI1, HSI2, HSI2UFS, PERIC0, PERIC1).
gpiolib reads each line's direction when the GPIO chip registers. The
GSACORE and GSACTRL entries, which have no node yet, stay without it,
as do the other SoCs, including gs101, whose secure pinctrl_gsactrl
must not be read by Linux.
With the callback, gpiochip_lock_as_irq() reads the pin direction and
returns -EIO for a GPIO configured as a push-pull output ("tried to
flag a GPIO set as output for IRQ"). exynos_irq_request_resources()
calls it before switching the pin to EINT, so a pin left as an output
by the bootloader can now be rejected at IRQ request time.
Earlier Pixel 9 Pro Fold testing with the unconditional callback
found no gpiolib.c:431 warning at boot, when the shared reset's
consumers bound, or when reading /sys/kernel/debug/gpio. The line
still read as an output driven low. On 2026-11-18, the Comet
integration kernel 7.3.0-rc6-omamobile-comet-rc2-cand21 had the
unconditional samsung_gpio_get_direction in kallsyms. Across two
boots with all interrupt consumers bound, dmesg had zero "tried to
flag a GPIO set as output for IRQ" lines.
Assisted-by: LLM
Signed-off-by: Nate Crawford <nate@kdegeek.com>
67cddd1 to
6d69ad6
Compare
|
Decided on the open choice from my review: please gate the callback to the Fold's SoC (zumapro), so no other phone's behaviour changes with this commit. Widening it to every SoC can be its own change later, with a boot on the 7 Pro. |
|
Derek, The current head, I moved The commit message now explains the IRQ path. With the callback, On November 18 I checked two Comet boots on I'll raise the gs101 secure-controller question with linux-samsung-soc when I send this upstream. |
Summary
Enable
get_direction()through the zumapro pin controller data shared by the Pixel 9 Pro Fold and Pixel 9a, for the eight controllerszumapro.dtsidescribes. GSACORE0-3 and GSACTRL, which have no node yet, stay without it. The callback reads the pin's function from the bank's CON register with the bus clock enabled. It reports GPIO output for function0x1and input for other functions.The shared GPIO proxy needs this callback for
gpp10-2, the main camera reset shared by the IMX787 and its LC898129 lens actuator. The missing callback produced threegpiolib.c:431warnings at boot and another when a driver requested the line.Evidence
Earlier Comet testing with the unconditional callback found no
gpiolib.c:431warnings at boot, when the reset consumers bound, or when reading/sys/kernel/debug/gpio. The line still read as an output driven low.On November 18, 2026, Comet's
7.3.0-rc6-omamobile-comet-rc2-cand21had the unconditionalsamsung_gpio_get_directionin kallsyms. Across two boots with all interrupt consumers bound, dmesg had zero “tried to flag a GPIO set as output for IRQ” lines.V2 merges cleanly onto
26867fc4e.checkpatch --strictreported zero warnings or checks, andpinctrl-samsung.candpinctrl-exynos-arm64.cboth built withW=1.Merge scope
GPIO chip registration reads each pin on controllers that opt in. On those controllers,
gpiochip_lock_as_irq()also reads the pin and can return-EIOfor a push-pull output beforeexynos_irq_request_resources()switches it to EINT. That can affect an IRQ on a pin the bootloader left configured as an output.Other SoCs retain their existing behaviour, including gs101's secure
pinctrl_gsactrl. A Pixel 9a boot check is still pending.🤖 Generated with Claude Code