[PATCH v4 0/2] i3c: dw-i3c-master: scoped spinlock guards and SIR reject fix

adrianhoyin.ng@altera.com posted 2 patches 1 week, 4 days ago
drivers/i3c/master/dw-i3c-master.c | 59 ++++++++++++++++--------------
1 file changed, 31 insertions(+), 28 deletions(-)
[PATCH v4 0/2] i3c: dw-i3c-master: scoped spinlock guards and SIR reject fix
Posted by adrianhoyin.ng@altera.com 1 week, 4 days ago
From: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>

This patchset replaces open-coded spin_lock_irqsave()/spin_unlock_irqrestore()
pairs with scoped spinlock guards to reduce boilerplate and ensure correct
lock release on scope exit.

In a subsequent patch it fixes the SIR reject bit mapping used for IBI
handling. The IBI_SIR_REQ_REJECT register is indexed by a folded form of
the 7-bit dynamic address, but the driver currently uses the device table
index. This can result in IBIs being rejected or accepted for the wrong
device. The patch derives the bit index directly from the dynamic address
as defined by the controller.

---
changelog
v3->v4:
- Dropped unused DYN_ADDR_LO_BITS definition.

v2->v3:
- Update guard function call in dw_i3c_master_free_ibi to use scoped_guard to avoid
  i3c_generic_ibi_free_pool happening under spinlock.
- Update get_ibi_sir_bit_index to use FIELD_GET and drop DYN_ADDR_LO_BITS definition.

v1->v2:
- Add implementation to use scoped spinlock guards to ensure correct lock release.
- Update remove DYN_ADDR_HI_BITS macro definition and update MASK to use index directly.
---

Adrian Ng Ho Yin (2):
  i3c: dw-i3c-master: convert spinlock usage to scoped guards
  i3c: dw-i3c-master: fix SIR reject bit mapping for dynamic addresses

 drivers/i3c/master/dw-i3c-master.c | 59 ++++++++++++++++--------------
 1 file changed, 31 insertions(+), 28 deletions(-)

-- 
2.49.GIT
Re: [PATCH v4 0/2] i3c: dw-i3c-master: scoped spinlock guards and SIR reject fix
Posted by Alexandre Belloni 1 week ago
On Tue, 27 Jan 2026 10:05:05 +0800, adrianhoyin.ng@altera.com wrote:
> From: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
> 
> This patchset replaces open-coded spin_lock_irqsave()/spin_unlock_irqrestore()
> pairs with scoped spinlock guards to reduce boilerplate and ensure correct
> lock release on scope exit.
> 
> In a subsequent patch it fixes the SIR reject bit mapping used for IBI
> handling. The IBI_SIR_REQ_REJECT register is indexed by a folded form of
> the 7-bit dynamic address, but the driver currently uses the device table
> index. This can result in IBIs being rejected or accepted for the wrong
> device. The patch derives the bit index directly from the dynamic address
> as defined by the controller.
> 
> [...]

Applied, thanks!

[1/2] i3c: dw-i3c-master: convert spinlock usage to scoped guards
      https://git.kernel.org/i3c/c/c7311aa4a71e
[2/2] i3c: dw-i3c-master: fix SIR reject bit mapping for dynamic addresses
      https://git.kernel.org/i3c/c/ed318b3fb4ab

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com