pinctrl: rp1: Honour direction in legacy brcm,function in/out - #7521
Open
nbuchwitz wants to merge 2 commits into
Open
pinctrl: rp1: Honour direction in legacy brcm,function in/out#7521nbuchwitz wants to merge 2 commits into
nbuchwitz wants to merge 2 commits into
Conversation
The legacy brcm,function values 0 and 1 select GPIO input and output as on BCM283x, but on RP1 the legacy map only muxes the pin to GPIO and never programs the RIO output enable, so the direction is left as-is. An interrupt line declared with brcm,function = <0> can stay an output. On Pi 5 the sc16is7xx overlay then storms its shared IRQ and saturates a CPU core. Many overlays declare their input and interrupt pins this way, so they share the same latent misconfiguration on RP1. Emit a direction config from the legacy map and let input and output enable program the RIO direction when the pin is a GPIO. Fixes: e3ce7b8 ("pinctrl: rp1: Implement RaspberryPi RP1 pinmux/pinconf support") Link: raspberrypi#7520 Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
Contributor
Author
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>
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.
The legacy brcm,function values 0 and 1 select GPIO input and output as on BCM283x, but on RP1 the legacy map only muxes the pin to GPIO and never programs the RIO output enable, so the direction is left as-is. An interrupt line declared with brcm,function = <0> can stay an output. On Pi 5 the sc16is7xx overlay then storms its shared IRQ and saturates a CPU core.
Many overlays declare their input and interrupt pins this way, so they share the same latent misconfiguration on RP1.
Emit a direction config from the legacy map and let input and output enable program the RIO direction when the pin is a GPIO.
Fixes: e3ce7b8 ("pinctrl: rp1: Implement RaspberryPi RP1 pinmux/pinconf support")
Link: #7520