From 25648fb7cebb7e1963afc31c07e650d703cfc140 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Sun, 20 Sep 2026 18:12:34 +0300 Subject: i3c: master: Match ACPI targets to the correct bus controller instance For ACPI-enumerated I3C targets, _ADR encodes both the zero-based bus controller instance number in bits 51:48 and the Provisioned ID (PID) in bits 47:0, as defined by ACPI 6.6 Table 6.2 and MIPI DisCo for I3C v1.1 section 5.2. However, i3c_master_add_acpi_dev() treats the entire _ADR value as the PID. On multi-instance controllers this folds the instance number into the PID, causing i3c_master_add_i3c_boardinfo() to reject devices on instance 1 and above with -EINVAL. The problem is exposed by the MIPI I3C HCI PCI driver, which creates one MFD child device per bus controller instance. Since the child devices do not have their own ACPI companions, they all inherit the parent's ACPI node and therefore enumerate the same set of child devices. As a result, a target belonging to any instance other than 0 prevents registration of all controller instances. Add an instance number to struct i3c_master_controller, propagate it from the HCI PCI driver, extract the PID from bits 47:0 of _ADR, and ignore ACPI child nodes that belong to a different controller instance. ACPI-enumerated I2C devices are unaffected. Their controller instance is encoded in the Resource Source Index of the I2cSerialBusV2 descriptor rather than in _ADR and will require separate handling. Fixes: b46a4b3c5d1e ("i3c: master: Support ACPI enumeration of child devices") Signed-off-by: Adrian Hunter Reviewed-by: Frank Li Link: https://patch.msgid.link/20260920151248.46936-5-adrian.hunter@intel.com Signed-off-by: Alexandre Belloni --- include/linux/platform_data/mipi-i3c-hci.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/platform_data') diff --git a/include/linux/platform_data/mipi-i3c-hci.h b/include/linux/platform_data/mipi-i3c-hci.h index ab7395f455f9..6f61d8a02378 100644 --- a/include/linux/platform_data/mipi-i3c-hci.h +++ b/include/linux/platform_data/mipi-i3c-hci.h @@ -3,13 +3,17 @@ #define INCLUDE_PLATFORM_DATA_MIPI_I3C_HCI_H #include +#include /** * struct mipi_i3c_hci_platform_data - Platform-dependent data for mipi_i3c_hci * @base_regs: Register set base address (to support multi-bus instances) + * @instance: Zero-based instance number of the Bus Controller as defined by the + * DisCo specification I3C Target Address (_ADR) Encoding */ struct mipi_i3c_hci_platform_data { void __iomem *base_regs; + u8 instance; }; #endif -- cgit v1.2.3