Skip to content

pinctrl: rp1: enable strict pinmux mode - #7522

Open
nbuchwitz wants to merge 3 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-pinmux-strict
Open

pinctrl: rp1: enable strict pinmux mode#7522
nbuchwitz wants to merge 3 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-pinmux-strict

Conversation

@nbuchwitz

Copy link
Copy Markdown
Contributor

Pins claimed for a peripheral function can be taken over through the GPIO chardev, which rewrites FUNCSEL. On Pi 5 reading the USB overcurrent pin this way trips the overcurrent latch and disables all USB ports, and requesting GPIO 42 as output cuts VBUS entirely.

Enable strict pinmux so GPIO requests on function pins are rejected. Implement function_is_gpio so pins muxed as GPIO, including hogs and legacy brcm,function maps, stay requestable. This matches the BCM2712 pinctrl-brcmstb driver.

Link: #5870

@nbuchwitz

Copy link
Copy Markdown
Contributor Author

Candidate for #5870

pelwell added a commit to pelwell/linux that referenced this pull request Jul 28, 2026
This is a less invasive solution to the problem that requesting that
a GPIO be used as an interrupt from Device Tree (not going via
gpio descriptors) does not automatically make it an input. This can lead
to interrupt storms.

It relies on there being an implementation of the function_is_gpio
method, hence the inclusion of Nicolai's patch from
raspberrypi#7522.

See: raspberrypi#7520

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@nbuchwitz
nbuchwitz force-pushed the devel/rp1-pinmux-strict branch from fd1e347 to e46c9d0 Compare July 28, 2026 20:25
The spi0 and spi8 CS groups mux their pins to the peripheral function
while the pins are actually driven via cs-gpios. Under strict pinmux the
overlapping function and GPIO claims are rejected and the SPI host fails
to probe. Mux them as GPIO to match how they are used.

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Pins claimed for a peripheral function can be taken over through the
GPIO chardev, which rewrites FUNCSEL. On Pi 5 reading the USB
overcurrent pin this way trips the overcurrent latch and disables all
USB ports, and requesting GPIO 42 as output cuts VBUS entirely.

Enable strict pinmux so GPIO requests on function pins are rejected.
Implement function_is_gpio so pins muxed as GPIO, including hogs and
legacy brcm,function maps, stay requestable. This matches the BCM2712
pinctrl-brcmstb driver.

Link: raspberrypi#5870
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
@nbuchwitz
nbuchwitz force-pushed the devel/rp1-pinmux-strict branch from e46c9d0 to 98ef53c Compare July 28, 2026 20:29
Drop the leaked rp1_node reference and test of_iomap() for NULL instead
of IS_ERR(), which never matches its return value.

Fixes: df868dc ("pinctrl: Reinstate the downstream pinctrl-rp1 driver")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
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