Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Sk Anirban <sk.anirban@intel.com>
Cc: igt-dev@lists.freedesktop.org, anshuman.gupta@intel.com,
	badal.nilawar@intel.com, riana.tauro@intel.com,
	karthik.poosa@intel.com, soham.purkait@intel.com,
	mallesh.koujalagi@intel.com
Subject: Re: [PATCH] tests/intel/xe_pm: include PCI domain in i2c adapter name
Date: Fri, 24 Jul 2026 09:53:36 +0200	[thread overview]
Message-ID: <amMaAK-nvFBxuRVh@black.igk.intel.com> (raw)
In-Reply-To: <20260722203536.2001775-2-sk.anirban@intel.com>

On Thu, Jul 23, 2026 at 02:05:37AM +0530, Sk Anirban wrote:
> 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/

Add this as a Link: tag.

> Signed-off-by: Sk Anirban <sk.anirban@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..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)));

Align this with above line.

>  	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)));

Ditto.

Reviewed-by: Raag Jadav <raag.jadav@intel.com>

>  	device_dir = opendir(device_path);
>  
>  	if (!device_dir)
> -- 
> 2.43.0
> 

      parent reply	other threads:[~2026-07-24  7:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 20:35 [PATCH] tests/intel/xe_pm: include PCI domain in i2c adapter name Sk Anirban
2026-07-22 22:26 ` ✓ i915.CI.BAT: success for " Patchwork
2026-07-22 22:41 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-23 21:25 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-24  3:29 ` ✓ i915.CI.Full: " Patchwork
2026-07-24  7:53 ` Raag Jadav [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=amMaAK-nvFBxuRVh@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.poosa@intel.com \
    --cc=mallesh.koujalagi@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=sk.anirban@intel.com \
    --cc=soham.purkait@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox