[PATCH v2] tests/intel/xe_pm: include PCI domain in i2c adapter name
Sk Anirban <[email protected]> Mon, 27 Jul 2026 23:54:22 +0530
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
The i2c_designware adapter name only encoded bus and device, which fails on non-zero PCI domains. Include the full domain/bus/device and widen the format specifier. Also fix IGT by using the devfn in the adapter id to match the kernel. v2: Fix code (Raag) Link: https://patchwork.freedesktop.org/series/170812/ Signed-off-by: Sk Anirban <[email protected]> Reviewed-by: Raag Jadav <[email protected]> --- tests/intel/xe_pm.c | 5 +++-- tests/intel/xe_survivability.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c index 6fbc13e43..7faba7c2b 100644 --- a/tests/intel/xe_pm.c +++ b/tests/intel/xe_pm.c @@ -866,8 +866,9 @@ static int find_i2c_adapter(device_t device, int sysfs_fd) /* Make sure the /dev/i2c-* files exist */ igt_require(igt_kmod_load("i2c-dev", NULL) == 0); - snprintf(adapter, sizeof(adapter), "%s.%hu", "device/i2c_designware", - (device.pci_xe->bus << 8) | (device.pci_xe->dev)); + snprintf(adapter, sizeof(adapter), "%s.%d", "device/i2c_designware", + (device.pci_xe->domain << 16 | device.pci_xe->bus << 8 | + (device.pci_xe->dev << 3 | device.pci_xe->func))); adapter_fd = openat(sysfs_fd, adapter, O_RDONLY); igt_require_fd(adapter_fd); diff --git a/tests/intel/xe_survivability.c b/tests/intel/xe_survivability.c index 74488bbea..b4f1dfb38 100644 --- a/tests/intel/xe_survivability.c +++ b/tests/intel/xe_survivability.c @@ -126,8 +126,9 @@ static int find_i2c_adapter(struct pci_device *pci_xe) igt_require(igt_kmod_load("i2c-dev", NULL) == 0); - snprintf(device_path, sizeof(device_path), "/sys/bus/pci/devices/%s/%s.%hu", bus_addr, - "i2c_designware", (pci_xe->bus << 8) | (pci_xe->dev)); + snprintf(device_path, sizeof(device_path), "/sys/bus/pci/devices/%s/%s.%d", bus_addr, + "i2c_designware", (pci_xe->domain << 16 | pci_xe->bus << 8 | + (pci_xe->dev << 3 | pci_xe->func))); device_dir = opendir(device_path); if (!device_dir) -- 2.43.0