Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Raag Jadav <raag.jadav@intel.com>
Cc: intel-xe@lists.freedesktop.org, matthew.d.roper@intel.com
Subject: Re: [PATCH v1] drm/xe/i2c: Allow per domain unique id
Date: Wed, 22 Jul 2026 18:47:46 +0300	[thread overview]
Message-ID: <amDmItz-EnvDNV9f@kuha> (raw)
In-Reply-To: <20260721113438.651100-1-raag.jadav@intel.com>

On Tue, Jul 21, 2026 at 05:04:38PM +0530, Raag Jadav wrote:
> PCI bus, device and function can be same for devices existing across
> different domains. Allow per domain unique identifier while registering
> platform device to prevent name conflict.
> 
> Fixes: f0e53aadd702 ("drm/xe: Support for I2C attached MCUs")
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>

FWIW:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/gpu/drm/xe/xe_i2c.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_i2c.c b/drivers/gpu/drm/xe/xe_i2c.c
> index bd956776b10b..a26c38bb17a1 100644
> --- a/drivers/gpu/drm/xe/xe_i2c.c
> +++ b/drivers/gpu/drm/xe/xe_i2c.c
> @@ -95,18 +95,21 @@ static int xe_i2c_register_adapter(struct xe_i2c *i2c)
>  	struct platform_device *pdev;
>  	struct fwnode_handle *fwnode;
>  	int ret;
> +	u32 id;
>  
>  	fwnode = fwnode_create_software_node(xe_i2c_adapter_properties, NULL);
>  	if (IS_ERR(fwnode))
>  		return PTR_ERR(fwnode);
>  
> +	id = (pci_domain_nr(pci->bus) << 16) | pci_dev_id(pci);
> +
>  	/*
>  	 * Not using platform_device_register_full() here because we don't have
>  	 * a handle to the platform_device before it returns. xe_i2c_notifier()
>  	 * uses that handle, but it may be called before
>  	 * platform_device_register_full() is done.
>  	 */
> -	pdev = platform_device_alloc(adapter_name, pci_dev_id(pci));
> +	pdev = platform_device_alloc(adapter_name, id);
>  	if (!pdev) {
>  		ret = -ENOMEM;
>  		goto err_fwnode_remove;
> -- 
> 2.43.0

-- 
heikki

      parent reply	other threads:[~2026-07-22 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 11:34 [PATCH v1] drm/xe/i2c: Allow per domain unique id Raag Jadav
2026-07-21 11:46 ` ✓ CI.KUnit: success for " Patchwork
2026-07-21 12:44 ` ✓ Xe.CI.BAT: " Patchwork
2026-07-21 21:33 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-22 16:56   ` Matt Roper
2026-07-22 15:47 ` Heikki Krogerus [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=amDmItz-EnvDNV9f@kuha \
    --to=heikki.krogerus@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=raag.jadav@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