]> git.ipfire.org Git - thirdparty/linux.git/commit
i3c: dw-i3c-master: Fix IBI count register selection for versalnet
authorShubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Wed, 1 Apr 2026 08:44:30 +0000 (14:14 +0530)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 30 Apr 2026 10:13:40 +0000 (12:13 +0200)
commit1d78a8fc97c133b8aee54993a83f86b68ed2fdb8
treed7178f24af5c1d4c877143fd9d30c78cb42f05b6
parent14236919b0e68ac9be6b425d5149a3ad4fd85914
i3c: dw-i3c-master: Fix IBI count register selection for versalnet

On DesignWare I3C controllers where IC_HAS_IBI_DATA=0 (such as versalnet),
the IBI_STS_CNT field (bits [28:24] of QUEUE_STATUS_LEVEL) is hardwired
to 0. The IBI status entry count is instead reported via IBI_BUF_BLR
(bits [23:16] of the same register).

irq_handle_ibis() was unconditionally reading IBI_STS_CNT, causing it to
always see 0 pending IBIs on versalnet and return early without draining
the IBI buffer. Since INTR_IBI_THLD_STAT is level-triggered against the
buffer fill level, this left the interrupt permanently asserted.

Detect IBI data capability at probe time by writing the IBI data threshold
field in QUEUE_THLD_CTRL and reading it back. Use the result to select the
correct register field in irq_handle_ibis().

Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Link: https://patch.msgid.link/20260401084430.436059-1-shubhrajyoti.datta@amd.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/dw-i3c-master.c
drivers/i3c/master/dw-i3c-master.h