Skip to content

i2c: mux: pca954x: Track unknown mux state and report deselect failures

Bart Van Assche linux-i2c lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3i2c: mux: pca954x: Track unknown channel statedrivers/i2c/muxes/i2c-mux-pca954x.c+14 -130 replies
2/3i2c: mux: pca954x: Introduce pca954x_set_idle_state()drivers/i2c/muxes/i2c-mux-pca954x.c+15 -100 replies
3/3i2c: mux: pca954x: Report deselect failuresdrivers/i2c/muxes/i2c-mux-pca954x.c+15 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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(-)