pinctrl: rp1: Make IRQ usage set a pin to an input - #7526
Open
pelwell wants to merge 2 commits into
Open
Conversation
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>
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>
This was referenced Jul 28, 2026
Contributor
|
Agreed, this is a cleaner and less instrisive approach. But I've added d9118ca to #7522 and with this, it works: Also picked f0d34ae as the remaining drive-by patch from my original PR. |
Contributor
Author
|
It's issues like this, considering the large number of overlays, that have made me reluctant to enable strict mode in our kernels. But maybe now is the time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
#7522.
See: #7520