Skip to content

[26.04_linux-nvidia-bos] Backport Vera I3C v7 support - #539

Closed
nirmoy wants to merge 21 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:vera-i3c-v7-7.0-bos
Closed

[26.04_linux-nvidia-bos] Backport Vera I3C v7 support#539
nirmoy wants to merge 21 commits into
NVIDIA:26.04_linux-nvidia-bosfrom
nirmoy:vera-i3c-v7-7.0-bos

Conversation

@nirmoy

@nirmoy nirmoy commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Backport the complete Vera I3C v7 series to the 26.04 BOS 7.0 kernel. The series adds the I3C core and DesignWare changes needed for Vera/Tegra410, ACPI matching for the controller, and SPD5118 hwmon support for DDR5 temperature monitoring.

This PR is only for 26.04_linux-nvidia-bos; Vera does not require a companion non-BOS kernel PR.

The backport contains:

  • all 12 patches from the upstream Vera I3C v7 series
  • the complete five-commit mainline ACPICA LVR prerequisite chain
  • one downstream BOS annotations commit that explicitly pins the inherited arm64 I3C and SPD5118 module policies
  • linux-next commit d2c743efd2d1ee64e94324664808f623dd865872, which fixes the I3C unregister descriptor lifetime
  • two NVIDIA: VR: SAUCE SETAASA follow-up fixes for firmware modalias generation and early device-add error propagation
  • linux-next commit 038cf48b3170af26a70bf2dee4f8c3ac910f5176, which fixes the empty-DAA UBSAN warning

Source series: https://lore.kernel.org/r/20260728065955.809445-1-akhilrajeev@nvidia.com

SETAASA follow-up series: https://lore.kernel.org/r/20260811103811.3380073-1-nirmoyd@nvidia.com

Backport adaptations for the Linux 7.0 BOS target are limited to:

  • use i3c_master_reattach_i3c_dev() because this BOS branch predates the _locked rename
  • resolve a context-only conflict in the ACPI child-enumeration patch because this branch predates surrounding I3C core changes; no code changes were made
  • resolve a context-only conflict in the DesignWare clock-quirk patch because this branch predates the IBI data-capability detection block; no code changes were made

Validation:

  • git diff --check passes against 26.04_linux-nvidia-bos
  • targeted builds pass for the affected ACPI, I3C, DesignWare I3C, and SPD5118 objects
  • the upstream unregister fix applies cleanly and its stable patch ID matches linux-next
  • annotation parsing confirms the explicit arm64 pins match the inherited m policies for both BOS flavours; amd64 continues to inherit its policies from debian.master
  • the earlier PR head completed Vera boot and focused I2C/I3C runtime validation with an I3C-capable SBIOS; final runtime validation of the review-updated head is pending

LP: https://bugs.launchpad.net/bugs/2139154

Add the 'mipi-i3c-static-method' property mentioned in the MIPI I3C
Discovery and Configuration Specification [1] to specify which discovery
method an I3C device supports during bus initialization. The property is
a bitmap, where a bit value of 1 indicates support for that method, and 0
indicates lack of support.

Bit 0: SETDASA CCC (Direct)
Bit 1: SETAASA CCC (Broadcast)
Bit 2: Other CCC (vendor / standards extension)
All other bits are reserved.

It is specifically needed when an I3C device requires SETAASA for the
address assignment. SETDASA will be supported by default if this property
is absent, which means for now the property just serves as a flag to
enable SETAASA, but keep the property as a bitmap to align with the
specifications.

[1] https://www.mipi.org/mipi-disco-for-i3c-download

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-2-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 81e7c27b0d5cb3029fc01374c3a96019d3a9e673 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Replace all OF-specific functions with unified device property functions
as a prerequisite to support both ACPI and device tree.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-3-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit ee170021bee17124c13f42813607bca553a6b48a linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add a new field called lvr to struct acpi_resource_i2c_serialbus.

Link: open-acpica/acpica@e62e74baf7e0
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2354060.iZASKD2KPV@rafael.j.wysocki
(cherry picked from commit f0ee0b0)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add LVR I2C resource entry to acpi_rs_convert_i2c_serial_bus[].

Link: open-acpica/acpica@c40411823510
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/23121545.EfDdHjke4D@rafael.j.wysocki
(cherry picked from commit 468adc6)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
In the LVR I2C resource entry to acpi_rs_convert_i2c_serial_bus[].

Link: open-acpica/acpica@7650d4a889ea
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3952474.kQq0lBPeGt@rafael.j.wysocki
(cherry picked from commit d364d76)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add a comment mentioning the LVR byte position in the type_specific_flag.

Link: open-acpica/acpica@014fa9f2dbcc
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/9627007.CDJkKcVGEf@rafael.j.wysocki
(cherry picked from commit 53a3a77)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
For ACPI_RSC_MOVE8, the 'Value' field in struct acpi_rsconvert_info
is the item count count and not a bit position like for the
bitflags. Set 'Value' as '1' to fix this.

Conversion still works coincidentally with '0' because
item_count is not reset between table entries, and the previous
count value was taking effect.

Link: open-acpica/acpica@70082dc8fc84
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/6164740.MhkbZ0Pkbq@rafael.j.wysocki
(cherry picked from commit 2543fbb)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ❌ Errors found

Details
Checking 21 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 01bde9aa65e4 │ i3c: dw: avoid shift-out-of-bounds when daa assigns no devices   │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 2c4120f0d932 │ i3c: master: propagate setaasa early device-add failures         │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 95ef2ec18787 │ i3c: master: emit firmware modalias for setaasa devices          │ noted      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 66f2b1563f22 │ i3c: master: fix info leak and uaf in device unregister path     │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6b28c857db50 │ [SAUCE] [config] pin i3c and spd5118 module policies for arm64   │ N/A        │ N/A     │ nirmoyd                   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3e14f60bf7c8 │ hwmon: spd5118: add i3c support                                  │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c34f14139535 │ hwmon: spd5118: remove 16-bit addressing                         │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 16f4b0de5638 │ i3c: dw-i3c-master: add acpi id for tegra410                     │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 9aea7d014801 │ [SAUCE] i3c: dw-i3c-master: add acpi core clock frequency quirk  │ N/A        │ N/A     │ akhilraj, belloni, nirmoy │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 29e42d080ed3 │ i3c: dw-i3c-master: add setaasa as supported ccc                 │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ c4caffbe69a4 │ i3c: master: match i3c device through dt and acpi                │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b7bb5bd86057 │ i3c: master: add support for devices without pid                 │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ b7697ab74c66 │ [SAUCE] i3c: master: add support for devices using setaasa       │ N/A        │ N/A     │ akhilraj, belloni, nirmoy │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 53ef02618450 │ [SAUCE] i3c: master: support acpi enumeration of child devices   │ N/A        │ N/A     │ akhilraj, belloni, nirmoy │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 6f89f1707afb │ 2543fbb21642 ACPICA: fix I2C LVR item count in the conversion ta │ match      │ match   │ preserved + nirmoyd added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 3bf2c0dc1f69 │ 53a3a7723c9e ACPICA: Mention the LVR bits                        │ match      │ match   │ preserved + nirmoyd added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ aca5628798d0 │ d364d76f3d0c ACPICA: Change LVR to 8 bit value                   │ match      │ match   │ preserved + nirmoyd added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 46d8c0c8fc07 │ 468adc6b1ff8 ACPICA: Fetch LVR I2C resource descriptor           │ match      │ match   │ preserved + nirmoyd added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 699c0854d5dc │ f0ee0b0927f7 ACPICA: Add LVR to acrestyp.h                       │ match      │ match   │ preserved + nirmoyd added │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 09a82f00cd79 │ i3c: master: use unified device property interface               │ match      │ found   │ ok, backporter: nirmoyd   │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ eaa22b7bfbe0 │ dt-bindings: i3c: add mipi-i3c-static-method to support setaasa  │ match      │ found   │ ok, backporter: nirmoyd   │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint results:
E: 9aea7d014801 ("i3c: dw-i3c-master: Add ACPI core clock frequency "): not SAUCE/UBUNTU/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)
E: b7697ab74c66 ("i3c: master: Add support for devices using SETAASA"): not SAUCE/UBUNTU/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)
E: 53ef02618450 ("i3c: master: Support ACPI enumeration of child dev"): not SAUCE/UBUNTU/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)

@nirmoy
nirmoy marked this pull request as ready for review August 10, 2026 15:08
@nirmoy nirmoy added the help wanted Extra attention is needed label Aug 10, 2026
@clsotog

clsotog commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

I have this comments from Codex:

  • High: drivers/hwmon/spd5118.c:749, drivers/i3c/master.c:317, debian.nvidia-bos/config/annotations:273
    spd5118 is built as a module, but the new I3C driver only has an OF match table and no I3C modalias. The I3C device uevent still emits only MODALIAS=i3c:...; for PID-less SETAASA devices that becomes the all-zero I3C alias, so spd5118.ko will not autoload. It will bind if already loaded, but Tegra410 will likely miss the sensor by default. Add firmware modalias support to the I3C uevent path for these devices, or
    provide another working module alias/load mechanism.
  • Medium: drivers/i3c/master.c:2253
    i3c_master_early_i3c_dev_add() now has a SETAASA path that must succeed for PID-less devices, but its return value is still ignored. For SETDASA this was recoverable after ENTDAA; for SETAASA/PID-less devices it is not. If attach/reattach fails, bus init continues, SETAASA is sent, and no device is registered. Propagate failures at least when static_addr_method & I3C_ADDR_METHOD_SETAASA.

@nvmochs

nvmochs commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

@nirmoy

a05cce2 i3c: master: Add support for devices using SETAASA

Nit: Use backported from, no blank line between pick tag and context note


One additional Codex finding...

• - High: debian.nvidia-bos/config/annotations:192 sets CONFIG_I3C=n on amd64 but leaves inherited I3C-dependent policies enabled. After olddefconfig, annotation validation reports 12 mismatches, including REGMAP_I3C, multiple I3C controllers/clients, I3C_OR_I2C, and SENSORS_SPD5118_DETECT. This can break amd64 configuration validation/package builds. Either retain I3C=m on amd64 or override all affected dependent policies.

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Reviewed all 17 commits at f3c0e1f14840. The backport itself is in very good
shape: 15 of the 16 cherry-picks are byte-identical to their cited upstream
commits, the one deviation is documented, and the affected objects build clean.
The points below are the delta on top of the annotations and Codex findings
already raised in this thread.

Backport fidelity

Comparing the added and removed lines of each pick against its cited upstream
commit, with context and hunk headers excluded, exactly one source line in the
whole series differs from upstream — the one a05cce2f8cec documents:

 commit 9, a05cce2f8cec
-               ret = i3c_master_reattach_i3c_dev_locked(i3cdev, 0);
+               ret = i3c_master_reattach_i3c_dev(i3cdev, 0);

09a82f00cd79, 46f5daecde96 and a6f892f3222e show differences only in
context lines and @@ header function names, from this tree lacking unrelated
upstream commits (no <linux/bitmap.h> in master.c; dw-i3c-master.c context
shows master->maxdevs = ret >> 16 where upstream shows
master->has_ibi_data = true). Payloads are identical, so no adaptation was
needed and none was made.

Tree attribution is correct throughout and the two trailer styles in this PR are
not inconsistent: the five ACPICA picks cite bare SHAs because those commits are
in mainline v7.2-rc1, while the i3c and hwmon picks carry linux-next because
they are in no release tag.

Built at the series tip for arm64 (defconfig plus CONFIG_ACPI=y,
CONFIG_I3C=m, CONFIG_DW_I3C_MASTER=m, CONFIG_SENSORS_SPD5118=m):

  CC [M]  drivers/hwmon/spd5118.o
  CC [M]  drivers/i3c/master.o
  CC [M]  drivers/i3c/master/dw-i3c-master.o
  CC      drivers/acpi/acpica/rsserial.o
  LD [M]  drivers/i3c/i3c.o

No warnings, and every identifier introduced by the backported code resolves in
this tree at the commit that uses it.

1. a05cce2f8cec: the backport note names the wrong commit

The note reads:

[nirmoy: use the pre-8d8afa428318 static reattach helper name]

8d8afa428318 ("i3c: master: Expose the APIs to support I3C hub") did not rename
anything. It exported a helper that was already called *_locked:

-static int i3c_master_reattach_i3c_dev_locked(struct i3c_dev_desc *dev,
+/**
+ * i3c_master_reattach_i3c_dev_locked() - reattach an I3C device with a new address

The rename was 79c41666b397 ("i3c: master: rename i3c_master_reattach_i3c_dev()
to *_locked"), the immediately preceding patch in the same NXP series, and it is
a pure rename of one definition and two call sites:

-static int i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
+static int i3c_master_reattach_i3c_dev_locked(struct i3c_dev_desc *dev,

As written the note is also self-contradictory: pre-8d8afa428318 the helper
was already named *_locked, which is the opposite of what the backport uses.

The adaptation itself is correct — this tree has
static int i3c_master_reattach_i3c_dev(...) with a body byte-identical to
upstream's *_locked version, the rename is applied to all three sites, and
git grep i3c_master_reattach_i3c_dev_locked a05cce2f8cec returns nothing
tree-wide. Only the SHA in the note needs correcting to 79c41666b397.

2. f3c0e1f14840: the arm64 half of the commit is a no-op

The subject is "Enable I3C and SPD5118 for Tegra410", but
debian.nvidia-bos/config/annotations opens with

include "../../debian.master/config/annotations"

and debian.master already carries all three symbols at m for arm64:

CONFIG_I3C              policy<{'amd64': 'm', 'arm64': 'm', ..., 's390x': 'n'}>
CONFIG_DW_I3C_MASTER    policy<{'amd64': 'm', 'arm64': 'm', ...}>
CONFIG_SENSORS_SPD5118  policy<{'amd64': 'm', 'arm64': 'm', ...}>

Exporting the flavour fragments before and after this commit confirms nothing
changes on the target:

arm64-nvidia-bos:     IDENTICAL before/after
arm64-nvidia-bos-64k: IDENTICAL before/after

amd64-nvidia-bos:
-CONFIG_DW_I3C_MASTER=m        +# CONFIG_DW_I3C_MASTER is not set
-CONFIG_I3C=m                  +# CONFIG_I3C is not set
-CONFIG_SENSORS_SPD5118=m      +# CONFIG_SENSORS_SPD5118 is not set

So the commit's only net effect is to disable three symbols on amd64. The
commit message should say that, or the arm64 entries should be dropped as
redundant.

3. f3c0e1f14840: disabling SPD5118 on amd64 removes an existing feature

i2c_register_spd() in drivers/i2c/i2c-smbus.c instantiates the "spd5118"
device for SMBIOS memory types 0x22 and 0x23, which is the x86 DMI path named
in the SENSORS_SPD5118_DETECT help text. Setting CONFIG_SENSORS_SPD5118=n on
amd64 therefore removes DDR5 module temperature reporting from
amd64-nvidia-bos, which is a user-visible regression unrelated to Tegra410
enablement.

Since the arm64 side needs no change at all (point 2), leaving all three symbols
at their inherited m on both arches would satisfy the stated goal and avoid
both this and the annotations failure.

Notes on the annotations finding already raised

The CONFIG_I3C=n breakage reported above in this thread reproduces. Running the
real tool at both the commit and its parent isolates what this commit causes from
pre-existing environment noise:

parent (f3c0e1f14840^):  28 mismatches
tip    (f3c0e1f14840):   41 mismatches
                         -- 13 added, all I3C related
CONFIG_AD4062              changed from m to -
CONFIG_ADI_I3C_MASTER      changed from m to -
CONFIG_CDNS_I3C_MASTER     changed from m to -
CONFIG_DW_I3C_MASTER       changed from n to -
CONFIG_I3C_OR_I2C          changed from m to y
CONFIG_IIO_ST_LSM6DSX_I3C  changed from m to -
CONFIG_INV_ICM45600_I3C    changed from m to -
CONFIG_MCTP_TRANSPORT_I3C  changed from m to -
CONFIG_MIPI_I3C_HCI        changed from m to -
CONFIG_MIPI_I3C_HCI_PCI    changed from m to -
CONFIG_REGMAP_I3C          changed from m to -
CONFIG_SENSORS_SPD5118_DETECT changed from n to -
CONFIG_SVC_I3C_MASTER      changed from m to -

Twelve of these are inherited from debian.master. The thirteenth,
CONFIG_DW_I3C_MASTER, is annotated 'n' by this commit where the resolved
value is -; the in-file precedent for a symbol that stops being emitted is '-'
(see CONFIG_GENERIC_CPU_CACHE_MAINTENANCE).

CONFIG_I3C_OR_I2C flips rather than disappears because of its default:

config I3C_OR_I2C
	tristate
	default m if I3C=m
	default I2C

With I3C=n and CONFIG_I2C=y it resolves to y against an inherited 'm'.

The check is build-gating: debian/rules.d/2-binary-arch.mk runs it inside
stamp-prepare-%, skipped only when do_mainline_build sets do_skip_checks.

The Codex autoload finding also reproduces — spd5118.c declares
MODULE_DEVICE_TABLE for i2c and of but not i3c, and i3c_device_uevent()
emits only MODALIAS=i3c:dcr%02Xmanuf%04Xpart%04Xext%04X with no firmware
modalias fallback of the kind i2c_device_uevent() has. For a PID-less SETAASA
device pid is 0, and the SETAASA path in i3c_master_early_i3c_dev_add()
returns before i3c_master_retrieve_dev_info(), so dcr is 0 as well and the
alias is all zeros.

@nirmoy
nirmoy force-pushed the vera-i3c-v7-7.0-bos branch 3 times, most recently from 6aa76a6 to da22aee Compare August 11, 2026 11:46
@nirmoy

nirmoy commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

@clsotog @nvmochs @jamieNguyenNVIDIA Thanks for the detailed reviews. let me know how the curr version looks

Comment thread drivers/i3c/master.c Outdated
@nvmochs

nvmochs commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

@nirmoy Confirmed that the latest update addresses my prior findings.

bd24cdc77ffd i3c: dw-i3c-master: Add ACPI core clock frequency quirk

Was this a clean pick or did it require context fixup? (codex says replaying the branch produces a conflict for this patch)


For any new patches / fixes, please be sure to add them to the tracking SS (new rows under the existing i3c row).

@clsotog

clsotog commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

This is the P1 finding from my codex session:
NV-Kernels/drivers/i3c/master.c:2770: ACPI child devices are consumed by the I3C parent but never marked enumerated. i3c_master_add_acpi_dev() builds boardinfo from ACPI fwnodes, then the core registers I3C/I2C child devices, but there is no acpi_device_set_enumerated() / clear pairing like I2C and SPI use. That can let _ADR-only I3C children fall through to ACPI default
platform-device creation, and leaves serial-bus children looking unhandled to ACPI remove/reconfiguration paths.

Although the existing subsystem allows host controllers to register
through the ACPI table, it was not possible to describe I3C or I2C
devices when using ACPI. This is because the driver relied on the reg
property to retrieve the PID, static address, etc., whereas ACPI uses
_ADR or serial resources to describe such devices.

Read _ADR and LVR from ACPI resources and extract the data as per the
ACPI specification for an I3C bus. Also read mipi-i3c-static-address as
per the MIPI DISCO specifications [1] to get the static address to be
used.

Enable describing I3C or I2C devices in the ACPI table. This is required
if the device uses a static address or if it needs device-specific
properties.

[1] https://www.mipi.org/mipi-disco-for-i3c-download

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-4-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(backported from commit b46a4b3c5d1e312e74e5364a04c283a5c88e0916 linux-next)
[nirmoy: Resolved a context conflict in drivers/i3c/master.c because this
branch predates surrounding I3C core changes. No code changes were made.]
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add support for devices using SETAASA, such as SPD5118 and SPD5108
attached to DDR5 memory modules that do not support ENTDAA. Follow the
guidelines proposed by the MIPI Discovery and Configuration
Specification [1] for discovering such devices.

SETAASA (Set All Addresses to Static Address) differs from standard I3C
address assignment that uses ENTDAA or SETDASA to assign dynamic
addresses. Devices using SETAASA assign their pre-defined static addresses
as their dynamic addresses during DAA, and it is not mandatory for these
devices to implement standard CCC commands like GETPID, GETDCR, or GETBCR.
For such devices, it is generally recommended to issue SETHID (specified
by JEDEC JESD300) as a prerequisite for SETAASA to stop HID bit flipping.

[1] https://www.mipi.org/mipi-disco-for-i3c-download

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://www.mipi.org/mipi-disco-for-i3c-download
Link: https://patch.msgid.link/20260728065955.809445-5-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(backported from commit bbaf8733b84846897d2d3b997ce650dd2d2539a4 linux-next)
[nirmoy: Used i3c_master_reattach_i3c_dev() because this branch predates the _locked rename.]
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Devices using SETAASA for address assignment are not required to have
a 48-bit PID according to the I3C specification. Allow such devices to
register and use the static address where PID was required.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-6-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit a1dd42fb82fa71bf4cb6462b4803b55d844c1286 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
SETAASA-based devices cannot always be identified by PID or DCR; the
standard I3C id_table matching may not be applicable. Allow such devices to
match through Device Tree or ACPI.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-7-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 3456baa2110c1fa31e7609ace50117346b99c3d4 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add SETAASA and SETHID to the supported list of CCC commands for
DesignWare I3C host controller.

SETAASA is a broadcast command that assigns predefined static addresses
to all I3C devices on the bus.

SETHID is to stop HID bit flipping by the SPD Hub to which the SPD devices
are connected. It is a prerequisite command to be sent before SETAASA as
recommended by JESD300-5 and JESD403 sideband bus specifications.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-8-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit fc6963aad560aebeb926e677aa26746c42c6223b linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Some ACPI-enumerated devices like Tegra410 do not expose the controller
core clock through the clk framework. Unlike device tree, ACPI on Arm does
not model clock providers. The hardware is expected to have its clocks
enabled by firmware before the OS takes over.

Make the core clock optional and allow selected ACPI devices to provide the
core clock rate through the "clock-frequency" _DSD property when the core
clock is absent.

Resolve device quirks before acquiring the core clock so platforms without
the ACPI skip-clock quirk still fail probe immediately when the clock is
missing, before any MMIO access.

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-9-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(backported from commit 0fd9549975b5b8186a78b654e02518113cc2ac93 linux-next)
[nirmoy: Resolved a context conflict in dw_i3c_common_probe() because this
branch predates the IBI data capability detection block. No code changes
were made.]
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Update variable names to generic names and add Tegra410 ACPI ID to
support the I3C controller in Tegra410, which is a DesignWare I3C host
controller.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-10-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 97d7cfb62a215ed5c64c6e7772545be4afab167f linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
akhilr-nv and others added 7 commits August 11, 2026 09:35
The intent of introducing 16-bit addressing was to support I3C, but it
turns out that I3C does not require reading the Legacy Mode register,
nor any specific encoding for page translation. The testing of 16-bit
code was limited and there are no known users for this feature. Remove
the sections that support 16-bit addressing and prepare the driver to
support I3C appropriately.

Suggested-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-11-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 7bf5a11dde2c957bf6751f6ba28fef66e848ac6d linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
Add a regmap config and a probe function to support I3C-based
communication with SPD5118 devices.

On an I3C bus, SPD5118 devices are enumerated via SETAASA and always
require an ACPI or device tree entry. Device matching is hence through
the OF match tables only and does not need an I3C class match table. The
device identity is verified in the type registers before proceeding to
the common probe function.

Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://patch.msgid.link/20260728065955.809445-12-akhilrajeev@nvidia.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 9cd3db0cda4741befa6de8af94eb371b9ec6d057 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…rm64

Vera uses the Tegra410 DesignWare I3C controller to access SPD5118
temperature sensors on DDR5 memory modules.

CONFIG_I3C, CONFIG_DW_I3C_MASTER, and CONFIG_SENSORS_SPD5118 already
resolve to modules for arm64 through the included debian.master policies.
Pin those inherited values explicitly in debian.nvidia-bos to document and
preserve the Vera platform requirement. Other architectures continue to
inherit their policies from debian.master.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
i3c_master_unregister_i3c_devs() clears i3cdev->dev->desc before
calling device_unregister().  During device_unregister(),
device_del() emits a KOBJ_REMOVE uevent and unbinds the driver while
the device descriptor is still expected to be valid.  As a result,
i3c_device_uevent() and a racing modalias_show() can observe a NULL
desc and fall back to an uninitialized stack struct i3c_device_info,
leaking kernel stack contents in the generated modalias.  Driver
.remove() callbacks may also encounter an unexpected NULL desc during
unbind.

Keep desc valid until device_unregister() has completed.  Since
device_unregister() drops the device reference and may free the device,
take an extra reference with get_device() before unregistering.  Clear
desc afterwards and release the extra reference with put_device().
This preserves the release-time invariant that desc must be NULL while
avoiding both the information leak and a potential use-after-free from
writing desc after the device has been released.

Reported-by: sashiko-bot@kernel.org
Link: https://lore.kernel.org/linux-i3c/20260702190003.8BF741F000E9@smtp.kernel.org/
Fixes: 3a379bb ("i3c: Add core I3C infrastructure")
Cc: stable@vger.kernel.org
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260723075747.34049-1-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit d2c743efd2d1ee64e94324664808f623dd865872 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…vices

SETAASA devices are allowed to omit their PID and device information
CCCs. The I3C core can match these devices through firmware descriptions,
but the uevent and sysfs modalias paths expose only an identity-based I3C
alias.

For a PID-less SETAASA device, that alias contains no useful identity and
cannot trigger loading of a driver that matches through Device Tree or
ACPI. Such a driver can bind when already loaded, but it is not
automatically loaded for the device.

For PID-less SETAASA devices, emit the Device Tree or ACPI modalias from
both paths when available. Preserve the existing I3C identity alias for
devices that report a PID and as a fallback when no firmware modalias can
be generated.

Fixes: 3456baa2110c ("i3c: master: match I3C device through DT and ACPI")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
(backported from https://lore.kernel.org/r/20260811103811.3380073-1-nirmoyd@nvidia.com)
[nirmoy: Keep direct descriptor access in i3c_device_uevent() to avoid recursive normal-use locking during device registration; d2c743efd2d1ee keeps the descriptor valid through unregister.]
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
…ilures

i3c_master_bus_init() ignores errors from
i3c_master_early_i3c_dev_add(). This is recoverable for SETDASA devices
because they can be discovered later through ENTDAA.

SETAASA devices do not participate in ENTDAA. If their early attach or
reattach fails, bus initialization still sends the SETAASA broadcast and
continues without registering the device. The target may consequently
have an active address without a corresponding I3C device.

Abort bus initialization when early device registration fails for a
SETAASA device. Preserve the existing fallback behavior for other static
address methods.

Fixes: bbaf8733b848 ("i3c: master: Add support for devices using SETAASA")
Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
(backported from https://lore.kernel.org/r/20260811103811.3380073-1-nirmoyd@nvidia.com)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
On an empty bus ENTDAA assigns nothing, so cmd->rx_len (the count
of addresses left unassigned) equals master->maxdevs.

The GENMASK() index master->maxdevs - cmd->rx_len - 1 then becomes -1,
which trips up UBSAN. This happens every time on boot on a Gigabyte/AMD
server:

    UBSAN: shift-out-of-bounds in drivers/i3c/master/dw-i3c-master.c:905:12
    shift exponent 64 is too large for 64-bit type 'long unsigned int'
    CPU: 7 UID: 0 PID: 963 Comm: (udev-worker) Not tainted 7.0.11-200.fc44.x86_64 #1 PREEMPT(lazy)
    Hardware name: Giga Computing E163-Z34-AAH1-000/MZ33-DC1-000, BIOS R32_F45 04/01/2026
    Call Trace:
     <TASK>
     dump_stack_lvl+0x5d/0x80
     ubsan_epilogue+0x5/0x2b
     __ubsan_handle_shift_out_of_bounds.cold+0xd7/0x1ab
     dw_i3c_master_daa.cold+0x1b/0x96 [dw_i3c_master]
     i3c_master_do_daa_ext.part.0+0x3e/0xf0 [i3c]

Skip the mask when no new device was assigned.

Fixes: 1dd728f ("i3c: master: Add driver for Synopsys DesignWare IP")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260630172904.2662160-1-kuba@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit 038cf48b3170af26a70bf2dee4f8c3ac910f5176 linux-next)
Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
@nirmoy

nirmoy commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator Author

BaseOS Kernel Review

Summary

Boro reported 8 findings.

Findings: Critical: 0, High: 0, Medium: 3, Low: 4, Info: 1

Latest watcher review: open review

Generated test plan: open test plan

Kernel deb build: successful (download debs, 4 files)

Head: 01bde9aa65e4

This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review.

@nirmoy
nirmoy force-pushed the vera-i3c-v7-7.0-bos branch from da22aee to 01bde9a Compare August 12, 2026 08:54
@nirmoy

nirmoy commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

@nirmoy Confirmed that the latest update addresses my prior findings.

bd24cdc77ffd i3c: dw-i3c-master: Add ACPI core clock frequency quirk

Was this a clean pick or did it require context fixup? (codex says replaying the branch produces a conflict for this patch)

It was not clean. context change needed, no code change ! Updated the patch to say backported from ...

For any new patches / fixes, please be sure to add them to the tracking SS (new rows under the existing i3c row).

Will add those

@nirmoy

nirmoy commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator Author

This is the P1 finding from my codex session: NV-Kernels/drivers/i3c/master.c:2770: ACPI child devices are consumed by the I3C parent but never marked enumerated. i3c_master_add_acpi_dev() builds boardinfo from ACPI fwnodes, then the core registers I3C/I2C child devices, but there is no acpi_device_set_enumerated() / clear pairing like I2C and SPI use. That can let _ADR-only I3C children fall through to ACPI default platform-device creation, and leaves serial-bus children looking unhandled to ACPI remove/reconfiguration paths.

Codex says:

The I2cSerialBus lifecycle concern is valid for dynamic ACPI reconfiguration, but I3C currently has no ACPI hotplug notifier.

So a upstream gap that is outscope for this PR.

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Acked-by: Jamie Nguyen <jamien@nvidia.com>

@nvmochs

nvmochs commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

@nirmoy Confirmed that the latest update addresses my prior findings.

bd24cdc77ffd i3c: dw-i3c-master: Add ACPI core clock frequency quirk

Was this a clean pick or did it require context fixup? (codex says replaying the branch produces a conflict for this patch)

It was not clean. context change needed, no code change ! Updated the patch to say backported from ...

For any new patches / fixes, please be sure to add them to the tracking SS (new rows under the existing i3c row).

Will add those

Thanks for addressing this, no further issues from me!

Acked-by: Matthew R. Ochs <mochs@nvidia.com>

@nirmoy nirmoy added has_2_acks and removed help wanted Extra attention is needed has_1_ack labels Aug 12, 2026
@clsotog

clsotog commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Acked-by: Carol L Soto <csoto@nvidia.com>

@jamieNguyenNVIDIA

Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants