[PATCH 0/3] i2c: mux: pca954x: Track unknown mux state and report deselect failures

From: Bart Van Assche

Date: Fri Nov 06 2026 - 15:34:51 EST


Hi Peter,

If a control register write to a pca954x mux fails (e.g. if only the ACK
was lost), the write may still have reached the hardware, leaving the
mux in an unknown state. Currently the driver records last_chan as 0
(disconnected) after any failed write, which causes idle_state_store()
to skip the disconnect write if the idle state is updated to
MUX_IDLE_DISCONNECT. In addition, failures in pca954x_deselect_mux() go
unnoticed because the i2c-mux core ignores the deselect return value.
Track an unknown mux state by setting last_chan to -1 after any failed
control register write, split out pca954x_set_idle_state() from
pca954x_deselect_mux(), and log a rate-limited warning when deselecting
a channel fails.

Please consider this series for the next merge window.

Thanks,

Bart.

Bart Van Assche (3):
i2c: mux: pca954x: Track unknown channel state
i2c: mux: pca954x: Introduce pca954x_set_idle_state()
i2c: mux: pca954x: Report deselect failures

drivers/i2c/muxes/i2c-mux-pca954x.c | 60 +++++++++++++++++++----------
1 file changed, 40 insertions(+), 20 deletions(-)