Skip to content

i2c: i2c-xiic: fix clearing of bnb irq and waiting/ clearing while atomic

Thilo Zirnstein linux-arm-kernel linux-i2c lkml 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest posting 2/22 patches 2 repliesIn review
  2. v4 posting 1/22 patches 2 repliesSuperseded
  3. v32 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch3 repliesSuperseded
v11 patch0 repliesSuperseded

Changes in v4 from the cover letter

- Fix timeout argument of polling in atomic context

Patches in v4 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2i2c: i2c-xiic: fix clearing of bnb irqdrivers/i2c/busses/i2c-xiic.c+32 -82 replies
2/2i2c: i2c-xiic: fix waiting/clearing while atomicdrivers/i2c/busses/i2c-xiic.c+25 -50 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchShubhrajyoti Datta
1/2R-b
2/2

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

Read the v4 thread

Cover letter [RESEND PATCH v4 0/2] i2c: i2c-xiic: fix clearing of bnb irq and waiting/ clearing while atomic

Resend due to inactivity since Nov 09.
I think PATCH v4 2/2 misses a review.
Anything I can do to move this further ?

Dear all,

This patch-series fixes the clearing routine for the bus not busy (bnb) irq plus the waiting and clearing routines while in atomic context.

The bnb is used to indicate that the current transfer is done. A high level view of the software flow for tx:

* init i2c controller
* prepare all registers ( fill fifo, enable irqs, ... )
* start i2c txfer
* clear and enable bnb
* wait for completion
* ( serve interrupts )
* ( bnb interrupt ): complete completion

The datasheet ( pg090-axi-iic, Interrupt-Status-Register ISR) states that the bnb bit can only be cleared if
the bus busy bit in the status register is set.
So the iic controller must have recognized that their is some activity on the bus. ( Start condition )

Currently the bnb bit is cleared without checking or waiting for this condition. This can lead to spurious bnb interrupts.

Andi suggested to use an atomic-save function to wait for bnb. This was applied for other waiting/ clearing functions, too.

Kind regards,

Thilo Zirnstein
---

RESEND v4
- Add Reviewed-by Tag

Changes in v4
- Fix timeout argument of polling in atomic context

Changes in v3
- Use atomic-save functions for waiting and clearing.
- Fix intendation
- Unintentional changes removed

Changes in v2:
- Unintentional changes removed.
---

Thilo Zirnstein (2):
i2c: i2c-xiic: fix clearing of bnb irq
i2c: i2c-xiic: fix waiting/clearing while atomic

 drivers/i2c/busses/i2c-xiic.c | 70 ++++++++++++++++++++++++++++-------
 1 file changed, 57 insertions(+), 13 deletions(-)

--
2.43.0