Skip to content

i2c: xiic: Fix broken locking

Marek Vasut linux-i2c 1 version Applied

Status from this message: Applied to for-next, thanks everyone!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 5 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6i2c: xiic: Fix broken locking on tx_msgdrivers/i2c/busses/i2c-xiic.c+16 -100 replies
2/6i2c: xiic: Drop broken interrupt handlerdrivers/i2c/busses/i2c-xiic.c+1 -240 replies
3/6i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process()drivers/i2c/busses/i2c-xiic.c+26 -110 replies
4/6i2c: xiic: Switch from waitqueue to completiondrivers/i2c/busses/i2c-xiic.c+18 -150 replies
5/6i2c: xiic: Only ever transfer single messagedrivers/i2c/busses/i2c-xiic.c+10 -340 replies
6/6i2c: xiic: Fix RX IRQ busy checkdrivers/i2c/busses/i2c-xiic.c+1 -10 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMichal Simek
SeriesA-b
1/6
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/6] i2c: xiic: Fix broken locking

Booting ZynqMP with XIIC I2C driver shows multitude of race conditions in the XIIC driver. This is because locking is completely missing from the driver, and there are odd corner cases where the hardware behaves strangely.

Most of these races could be triggered easily when booting on SMP machines, like the ZynqMP which has up to 4 cores. It is sufficient for the interrupt handler to run on another core than xiic_start_xfer and the driver fails completely.

This does not add support for long transfers, this only fixes the driver to be usable at all instead of being completely broken.

The V2 fixes a few remaining details which cropped up in deployment over the last year or so, so I believe the result should be reasonably well tested.

Marek Vasut (6):
i2c: xiic: Fix broken locking on tx_msg
i2c: xiic: Drop broken interrupt handler
i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in
xiic_process()
i2c: xiic: Switch from waitqueue to completion
i2c: xiic: Only ever transfer single message
i2c: xiic: Fix RX IRQ busy check

 drivers/i2c/busses/i2c-xiic.c | 161 +++++++++++++++-------------------
 1 file changed, 69 insertions(+), 92 deletions(-)
Cc Michal Simek <[email protected]>
Cc Shubhrajyoti Datta <[email protected]>
Cc Wolfram Sang <[email protected]>
Signature · 1 line
2.32.0