From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 63B5AC4453A for ; Wed, 22 Jul 2026 20:44:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0A56A10E4CA; Wed, 22 Jul 2026 20:44:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="KWGl6yx8"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDC5210E4CA for ; Wed, 22 Jul 2026 20:43:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1784753040; x=1816289040; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dbwsErfP4Y9eALzc35DCDT8ed9z+Rj3X8sVQbjJq8vw=; b=KWGl6yx8YJaoIup4B8n6LpoO8QMHYItvIl5g8l3iD3xE/Gb1mrQhloPz OYIPl3KZWr1hgl3tLo4yKcphURgz0XkOpI/0bOJl+/m//rQmmeBS3q6GU CY96IgzRRavr8ow8oy72fwWCZh44a9zsmXZLAPqtmqsYKN5gldRE62SJ7 xoj3mVCRq8C26jCL3GPbbrb8lomKsbBaOLcPX5AZ7EkEyxJlFj6ZLdHr1 +F6vaSQ18udtTXiCoWyIpseCfWUCovJ/Sd/sFMF7mC61c3Hqo2n2jV7dc pHCqvRxE9eGjhTxxworQSwRaqihAKvcAz/g/A9Gd4BwOpM8H3J448Uc1Z g==; X-CSE-ConnectionGUID: VH0V50kpRgOJbZ2oaosnPA== X-CSE-MsgGUID: yHYWy6n3T2OG7Ae8WE1P5Q== X-IronPort-AV: E=McAfee;i="6800,10657,11854"; a="85254701" X-IronPort-AV: E=Sophos;i="6.25,179,1779174000"; d="scan'208";a="85254701" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2026 13:44:00 -0700 X-CSE-ConnectionGUID: 54QtjMwISOmbdEIWl65XrA== X-CSE-MsgGUID: EMRpFs+RQhC5gSrEQTHCMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,179,1779174000"; d="scan'208";a="256965521" Received: from anirban-z690i-a-ultra-plus.iind.intel.com ([10.190.216.83]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2026 13:43:56 -0700 From: Sk Anirban To: igt-dev@lists.freedesktop.org Cc: anshuman.gupta@intel.com, badal.nilawar@intel.com, riana.tauro@intel.com, karthik.poosa@intel.com, raag.jadav@intel.com, soham.purkait@intel.com, mallesh.koujalagi@intel.com, Sk Anirban Subject: [PATCH] tests/intel/xe_pm: include PCI domain in i2c adapter name Date: Thu, 23 Jul 2026 02:05:37 +0530 Message-ID: <20260722203536.2001775-2-sk.anirban@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" 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. kernel implementation: https://patchwork.freedesktop.org/series/170812/ Signed-off-by: Sk Anirban --- 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..840e3f0be 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.%u", "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..d72884e70 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.%u", 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