Skip to content

i3c: Fix IBI race, address handling, and reconcile DAA

Adrian Hunter linux-i3c lkml 4 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 1 replyApplied
  2. v37 patches 2 repliesSuperseded
  3. v27 patches 10 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v17 patches0 repliesSuperseded

Changes in v4 from the cover letter

i3c: master: Prevent reuse of dynamic address on device add failure
i3c: master: Reconcile dynamic addresses after DAA
Add Frank's Rev'd-by

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/7i3c: mipi-i3c-hci: Fix race in i3c_hci_addr_to_dev()drivers/i3c/master/mipi-i3c-hci/core.c drivers/i3c/master/mipi-i3c-hci/dma.c drivers/i3c/master/mipi-i3c-hci/hci.h +2 more+47 -180 replies
2/7i3c: mipi-i3c-hci: Ignore DISEC failures when disabling IBIsdrivers/i3c/master/mipi-i3c-hci/core.c+7 -10 replies
3/7i3c: master: Prevent reuse of dynamic address on device add failuredrivers/i3c/master.c+14 -50 replies
4/7i3c: mipi-i3c-hci: Tolerate i3c_master_add_i3c_dev_locked() failures in DAAdrivers/i3c/master/mipi-i3c-hci/cmd_v1.c drivers/i3c/master/mipi-i3c-hci/cmd_v2.c+2 -60 replies
5/7i3c: master: Make i3c_master_add_i3c_dev_locked() return voiddrivers/i3c/master.c include/linux/i3c/master.h+5 -150 replies
6/7i3c: master: Move DAA API functions after i3c_master_add_i3c_dev_locked()drivers/i3c/master.c+64 -640 replies
7/7i3c: master: Reconcile dynamic addresses after DAAdrivers/i3c/master.c+117 -20 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchFrank Li
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH V4 0/7] i3c: Fix IBI race, address handling, and reconcile DAA

Hi

Note all patches have now been reviewed by Frank.

Patches 1-2 fix a use-after-free race in the MIPI I3C HCI driver's IBI handling and make IBI teardown resilient to DISEC failures.

Patches 3-7 fix address management issues in the I3C core and HCI driver that arise when Dynamic Address Assignment (DAA) does not complete cleanly, culminating in a reconciliation step that detects and resolves inconsistencies between assigned address slots and registered devices.

Patches are based on top of:

[PATCH V3 0/8] i3c: Hot-Join improvements and MIPI HCI Hot-Join support
https://lore.kernel.org/linux-i3c/[email protected]

which, in turn, applies on top of:

[PATCH V5 00/17] i3c: mipi-i3c-hci: DMA abort, recovery and related improvements
https://lore.kernel.org/linux-i3c/[email protected]

Changes in V4:
i3c: master: Prevent reuse of dynamic address on device add failure
i3c: master: Reconcile dynamic addresses after DAA
Add Frank's Rev'd-by

Changes in V3:
i3c: mipi-i3c-hci: Fix race in i3c_hci_addr_to_dev()
i3c: mipi-i3c-hci: Ignore DISEC failures when disabling IBIs
Add Frank's Rev'd-by

i3c: master: Prevent reuse of dynamic address on device add failure
Add note to commit message about Direct RSTDAA deprecation

i3c: mipi-i3c-hci: Tolerate i3c_master_add_i3c_dev_locked() failures in DAA
i3c: master: Make i3c_master_add_i3c_dev_locked() return void
i3c: master: Move DAA API functions after i3c_master_add_i3c_dev_locked()
Add Frank's Rev'd-by

i3c: master: Reconcile dynamic addresses after DAA
Add comment about the source of I3C_DEV_PROBE_* macro values. Also account for static_addr in i3c_master_reconcile_dyn_addrs()

Changes in V2:
i3c: mipi-i3c-hci: Fix race in i3c_hci_addr_to_dev()
Factor out __i3c_hci_disable_ibi() to facilitate also clearing ibi_devs[dat_idx] upon IBI free, and update commit message accordingly.
Demote a message in PIO and DMA IBI handling, and update commit message accordingly.

i3c: mipi-i3c-hci: Ignore DISEC failures when disabling IBIs
Re-base due to changes in previous patch.

i3c: master: Prevent reuse of dynamic address on device add failure
Fix 'if (IS_ERR(newdev)' error path.
Be defensive and do not change the addr_slot_status if it is not free, and update commit message accordingly.
Amend commit message to note removal of unnecesary 'if (!master)' check.
Add Fixes tag.

i3c: mipi-i3c-hci: Tolerate i3c_master_add_i3c_dev_locked() failures in DAA
None

i3c: master: Make i3c_master_add_i3c_dev_locked() return void
Re-base due to changes in previous patches.

i3c: master: Move DAA API functions after i3c_master_add_i3c_dev_locked()
None

i3c: master: Reconcile dynamic addresses after DAA
Add bitmap.h include for bitmap_zero() etc. Re-base due to changes in previous patches.

Adrian Hunter (7):
i3c: mipi-i3c-hci: Fix race in i3c_hci_addr_to_dev()
i3c: mipi-i3c-hci: Ignore DISEC failures when disabling IBIs
i3c: master: Prevent reuse of dynamic address on device add failure
i3c: mipi-i3c-hci: Tolerate i3c_master_add_i3c_dev_locked() failures in DAA
i3c: master: Make i3c_master_add_i3c_dev_locked() return void
i3c: master: Move DAA API functions after i3c_master_add_i3c_dev_locked()
i3c: master: Reconcile dynamic addresses after DAA

 drivers/i3c/master.c                     | 279 ++++++++++++++++++++++---------
 drivers/i3c/master/mipi-i3c-hci/cmd_v1.c |   4 +-
 drivers/i3c/master/mipi-i3c-hci/cmd_v2.c |   4 +-
 drivers/i3c/master/mipi-i3c-hci/core.c   |  45 ++++-
 drivers/i3c/master/mipi-i3c-hci/dma.c    |   7 +-
 drivers/i3c/master/mipi-i3c-hci/hci.h    |   1 +
 drivers/i3c/master/mipi-i3c-hci/ibi.h    |  13 +-
 drivers/i3c/master/mipi-i3c-hci/pio.c    |   7 +-
 include/linux/i3c/master.h               |   3 +-
 9 files changed, 254 insertions(+), 109 deletions(-)

Regards
Adrian