mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
i3c: mipi-i3c-hci: Restore controller state if i3c_hci_enable_ibi() returns an error
i3c_hci_enable_ibi() performs controller-side setup before sending the
ENEC CCC to enable IBIs on the target. If the ENEC CCC fails, the
function returns an error but leaves the controller configured as if IBI
enabling had succeeded.
Fix the error path by undoing the earlier setup when the ENEC CCC fails,
ensuring the controller state remains consistent with the failed enable
operation.
Fixes: 9ad9a52cce ("i3c/master: introduce the mipi-i3c-hci driver")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260920151248.46936-7-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
48d7187c98
commit
ad869331ac
|
|
@ -703,11 +703,15 @@ static int i3c_hci_enable_ibi(struct i3c_dev_desc *dev)
|
|||
struct i3c_master_controller *m = i3c_dev_get_master(dev);
|
||||
struct i3c_hci *hci = to_i3c_hci(m);
|
||||
struct i3c_hci_dev_data *dev_data = i3c_dev_get_master_data(dev);
|
||||
int ret;
|
||||
|
||||
mipi_i3c_hci_dat_v1.clear_flags(hci, dev_data->dat_idx, DAT_0_SIR_REJECT, 0);
|
||||
scoped_guard(spinlock_irqsave, &hci->lock)
|
||||
hci->ibi_devs[dev_data->dat_idx] = dev;
|
||||
return i3c_master_enec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
|
||||
ret = i3c_master_enec_locked(m, dev->info.dyn_addr, I3C_CCC_EVENT_SIR);
|
||||
if (ret)
|
||||
__i3c_hci_disable_ibi(hci, dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int i3c_hci_disable_ibi(struct i3c_dev_desc *dev)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user