Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tests/intel/xe_pm: include PCI domain in i2c adapter name
@ 2026-07-27 18:24 Sk Anirban
  2026-07-27 20:08 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pm: include PCI domain in i2c adapter name (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sk Anirban @ 2026-07-27 18:24 UTC (permalink / raw)
  To: igt-dev
  Cc: anshuman.gupta, badal.nilawar, riana.tauro, karthik.poosa,
	raag.jadav, soham.purkait, mallesh.koujalagi, Sk Anirban

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 <sk.anirban@intel.com>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-31  5:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 18:24 [PATCH v2] tests/intel/xe_pm: include PCI domain in i2c adapter name Sk Anirban
2026-07-27 20:08 ` ✓ Xe.CI.BAT: success for tests/intel/xe_pm: include PCI domain in i2c adapter name (rev2) Patchwork
2026-07-27 20:38 ` ✓ i915.CI.BAT: " Patchwork
2026-07-28  0:02 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-31  5:48   ` Anirban, Sk
2026-07-28  3:38 ` ✗ i915.CI.Full: " Patchwork
2026-07-31  5:52   ` Anirban, Sk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox