[PATCH v1 0/2] pinctrl / 8250_dw: Allow drivers to keep init pinctrl state until first open
From: Michał Kardaś
Date: Mon Aug 10 2026 - 09:24:13 EST
During device probe, pinctrl_bind_pins() binds pins to their "init" state
if specified in Device Tree. When probe finishes, pinctrl_init_done()
automatically transitions the pins from "init" to "default" state.
While this auto-transition works well for devices that are immediately
active upon driver binding, certain peripherals (such as power-sequenced
devices connected over UART, SPI, or other buses) remain unpowered until
userspace explicitly opens the device node or attaches a protocol driver.
On board designs where the connected peripheral is kept unpowered during
boot, auto-selecting "default" pin states (where signals such as TXD or
RTS may be driven high or pulled up) can cause parasitic back-powering
into the unpowered peripheral through its ESD protection diodes.
To address this without requiring new Device Tree binding names, this
series extends the existing "init" pinctrl state mechanism (introduced
in commit ef0eebc05130 ("drivers/pinctrl: Add the concept of an "init"
state")):
1. Patch 1 (pinctrl core):
Adds pinctrl_keep_init_state(dev). When called during probe,
pinctrl_init_done() opts out of the automatic "init" -> "default"
transition, allowing the driver to keep pins in the safe "init" state
upon probe completion. Updates Documentation/driver-api/pin-control.rst.
Board configurations that do not define an "init" state are completely
unaffected.
2. Patch 2 (8250_dw serial driver):
Updates 8250_dw so that when an "init" state is defined for the port,
the driver calls pinctrl_keep_init_state() and preserves the "init"
state until the port is first opened via dw8250_do_pm(), at which point
it transitions to "default" state and resumes normal operation.
Testing:
- Built and verified with CONFIG_PINCTRL=y and CONFIG_PINCTRL=n on
upstream tree.
- Verified zero checkpatch warnings (`checkpatch.pl --strict`).
- Note: Functional hardware testing was performed on a downstream kernel
tree where the physical back-powering issue was reproduced and verified
fixed. The underlying UART pinctrl lifecycle issue and core logic apply
identically to upstream.
Michał Kardaś (2):
pinctrl: core: Allow drivers to keep "init" pinctrl state after probe
tty: serial: 8250_dw: Keep init pinctrl state until first open
Documentation/driver-api/pin-control.rst | 10 ++++++----
drivers/pinctrl/core.c | 20 ++++++++++++++++++++
drivers/tty/serial/8250/8250_dw.c | 13 ++++++++++++-
include/linux/pinctrl/consumer.h | 6 ++++++
include/linux/pinctrl/devinfo.h | 2 ++
5 files changed, 46 insertions(+), 5 deletions(-)
--
2.55.0.654.g21b8a5bc05-goog