Skip to content

Commit f311a05

Browse files
hoyin0722alexandrebelloni
authored andcommitted
i3c: dw-i3c-master: Set SIR_REJECT in DAT on device attach and reattach
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: 1dd728f ("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> Link: https://patch.msgid.link/53f5b8cbdd8af789ec38b95b02873f32f9182dd6.1770962368.git.adrianhoyin.ng@altera.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent f26ecaa commit f311a05

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/i3c/master/dw-i3c-master.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
10241024
master->free_pos &= ~BIT(pos);
10251025
}
10261026

1027-
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
1027+
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr) | DEV_ADDR_TABLE_SIR_REJECT,
10281028
master->regs +
10291029
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
10301030

@@ -1053,7 +1053,7 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
10531053
master->free_pos &= ~BIT(pos);
10541054
i3c_dev_set_master_data(dev, data);
10551055

1056-
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr),
1056+
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->devs[pos].addr) | DEV_ADDR_TABLE_SIR_REJECT,
10571057
master->regs +
10581058
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
10591059

0 commit comments

Comments
 (0)