* [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
@ 2026-02-13 6:00 adrianhoyin.ng
2026-02-13 16:01 ` Frank Li
2026-03-11 21:52 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: adrianhoyin.ng @ 2026-02-13 6:00 UTC (permalink / raw)
To: alexandre.belloni, Frank.Li, linux-i3c, linux-kernel; +Cc: adrianhoyin.ng
From: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
The DesignWare I3C master controller ACKs IBIs as soon as a valid
Device Address Table (DAT) entry is present. This can create a race
between device attachment (after DAA) and the point where the client
driver enables IBIs via i3c_device_enable_ibi().
Set DEV_ADDR_TABLE_SIR_REJECT in the DAT entry during
attach_i3c_dev() and reattach_i3c_dev() so that IBIs are rejected
by default. The bit is managed thereafter by the existing
dw_i3c_master_set_sir_enabled() function, which clears it in
enable_ibi() after ENEC is issued, and restores it in disable_ibi()
after DISEC.
Fixes: 1dd728f5d4d4 ("i3c: master: Add driver for Synopsys DesignWare IP")
Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
---
changelog:
v1->v2:
* Update commit message for better clarity on SIR_REJECT bit clear upon
enable ibi call.
* Add Fixes tag.
---
drivers/i3c/master/dw-i3c-master.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 7eb09ad10171..d014f2cd6071 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1024,7 +1024,7 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
master->free_pos &= ~BIT(pos);
}
- writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr) | DEV_ADDR_TABLE_SIR_REJECT,
master->regs +
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
@@ -1053,7 +1053,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
master->free_pos &= ~BIT(pos);
i3c_dev_set_master_data(dev, data);
- writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr),
+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr) | DEV_ADDR_TABLE_SIR_REJECT,
master->regs +
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
--
2.49.GIT
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
2026-02-13 6:00 [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach adrianhoyin.ng
@ 2026-02-13 16:01 ` Frank Li
2026-03-11 21:52 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-02-13 16:01 UTC (permalink / raw)
To: adrianhoyin.ng; +Cc: alexandre.belloni, linux-i3c, linux-kernel
On Fri, Feb 13, 2026 at 02:00:48PM +0800, adrianhoyin.ng@altera.com wrote:
> From: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
>
> The DesignWare I3C master controller ACKs IBIs as soon as a valid
> Device Address Table (DAT) entry is present. This can create a race
> between device attachment (after DAA) and the point where the client
> driver enables IBIs via i3c_device_enable_ibi().
>
> Set DEV_ADDR_TABLE_SIR_REJECT in the DAT entry during
> attach_i3c_dev() and reattach_i3c_dev() so that IBIs are rejected
> by default. The bit is managed thereafter by the existing
> dw_i3c_master_set_sir_enabled() function, which clears it in
> enable_ibi() after ENEC is issued, and restores it in disable_ibi()
> after DISEC.
>
> Fixes: 1dd728f5d4d4 ("i3c: master: Add driver for Synopsys DesignWare IP")
> Signed-off-by: Adrian Ng Ho Yin <adrianhoyin.ng@altera.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> ---
> changelog:
> v1->v2:
> * Update commit message for better clarity on SIR_REJECT bit clear upon
> enable ibi call.
> * Add Fixes tag.
>
> ---
> drivers/i3c/master/dw-i3c-master.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
> index 7eb09ad10171..d014f2cd6071 100644
> --- a/drivers/i3c/master/dw-i3c-master.c
> +++ b/drivers/i3c/master/dw-i3c-master.c
> @@ -1024,7 +1024,7 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
> master->free_pos &= ~BIT(pos);
> }
>
> - writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
> + writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr) | DEV_ADDR_TABLE_SIR_REJECT,
> master->regs +
> DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
>
> @@ -1053,7 +1053,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
> master->free_pos &= ~BIT(pos);
> i3c_dev_set_master_data(dev, data);
>
> - writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr),
> + writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr) | DEV_ADDR_TABLE_SIR_REJECT,
> master->regs +
> DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
>
> --
> 2.49.GIT
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
2026-02-13 6:00 [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach adrianhoyin.ng
2026-02-13 16:01 ` Frank Li
@ 2026-03-11 21:52 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2026-03-11 21:52 UTC (permalink / raw)
To: Frank.Li, linux-i3c, linux-kernel, adrianhoyin.ng
On Fri, 13 Feb 2026 14:00:48 +0800, adrianhoyin.ng@altera.com wrote:
> The DesignWare I3C master controller ACKs IBIs as soon as a valid
> Device Address Table (DAT) entry is present. This can create a race
> between device attachment (after DAA) and the point where the client
> driver enables IBIs via i3c_device_enable_ibi().
>
> Set DEV_ADDR_TABLE_SIR_REJECT in the DAT entry during
> attach_i3c_dev() and reattach_i3c_dev() so that IBIs are rejected
> by default. The bit is managed thereafter by the existing
> dw_i3c_master_set_sir_enabled() function, which clears it in
> enable_ibi() after ENEC is issued, and restores it in disable_ibi()
> after DISEC.
>
> [...]
Applied, thanks!
[1/1] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
https://git.kernel.org/abelloni/c/f311a0578463
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-11 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-13 6:00 [PATCH v2] i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach adrianhoyin.ng
2026-02-13 16:01 ` Frank Li
2026-03-11 21:52 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®