Skip to content

pinctrl: rp1: Honour direction in legacy brcm,function in/out - #7521

Open
nbuchwitz wants to merge 2 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-legacy-gpio-dir
Open

pinctrl: rp1: Honour direction in legacy brcm,function in/out#7521
nbuchwitz wants to merge 2 commits into
raspberrypi:rpi-6.18.yfrom
nbuchwitz:devel/rp1-legacy-gpio-dir

Conversation

@nbuchwitz

Copy link
Copy Markdown
Contributor

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

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>
@nbuchwitz

Copy link
Copy Markdown
Contributor Author

Potential fix for #7520
@pelwell, could you kick off the build on this? Thanks

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