All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Vinod Govindapillai" <vinod.govindapillai@intel.com>
Cc: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v6 1/7] drm/xe/pm: initialize the device's system wakeup capabilities
Date: Mon, 14 Sep 2026 20:00:26 +0000	[thread overview]
Message-ID: <20260914200026.90F791F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914194737.272679-2-vinod.govindapillai@intel.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Using devm_device_init_wakeup() on a PCI device corrupts bus-managed can_wakeup state on unbind.
- [Medium] Unconditional execution of devm_device_init_wakeup() forcefully overrides PCI PME capabilities and violates SR-IOV VF constraints.
--

commit df4a3e5da10819a464844de67d48ba7d13070965
Author: Vinod Govindapillai <vinod.govindapillai@intel.com>

drm/xe/pm: initialize the device's system wakeup capabilities

This commit enables the device as a wakeup device so display hotplugs can
generate PM PME events. This enables invoking the PM runtime resume routine
for NVL+ XE devices.

> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 5f2a0b19839d1..32e10e1a26eff 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -1200,6 +1200,10 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	pci_set_master(pdev);
>  
> +	err = devm_device_init_wakeup(&pdev->dev);

[Severity: High]
Does calling devm_device_init_wakeup() on a PCI device corrupt the
bus-managed can_wakeup state on unbind?

When the driver is unbound, the devres cleanup triggers
device_disable_wakeup(), which explicitly calls
device_set_wakeup_capable(dev, false). This causes the device to permanently
lose its can_wakeup capability in the driver model, breaking PME capabilities
and userspace sysfs interfaces after a driver unbind/rebind cycle.

Should the driver use device_wakeup_enable() to toggle only the
should_wakeup state, rather than overriding the bus-owned capability flag set
during bus enumeration?

[Severity: Medium]
Does this unconditional execution of devm_device_init_wakeup() forcefully
override PCI PME capabilities and violate SR-IOV VF constraints?

The driver forcefully sets can_wakeup = true on devices that physically do
not support PME (like Virtual Functions or older hardware), leading to
invalid sysfs attributes and potential power management misbehavior.

This happens before xe_probe_info_early() determines the hardware generation
and without checking IS_SRIOV_VF() to ensure this PF-only power management
configuration is not executed on VFs. Should this initialization be
conditionally guarded based on the hardware capabilities and virtual function
constraints?

> +	if (err)
> +		return err;
> +
>  	err = xe_probe_info_early(xe, desc, &probed_info);
>  	if (err)
>  		return err;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914194737.272679-1-vinod.govindapillai@intel.com?part=1

  reply	other threads:[~2026-09-14 20:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 19:47 [PATCH v6 0/7] pm_pme support on display hotplug Vinod Govindapillai
2026-09-14 19:47 ` [PATCH v6 1/7] drm/xe/pm: initialize the device's system wakeup capabilities Vinod Govindapillai
2026-09-14 20:00   ` sashiko-bot [this message]
2026-09-14 19:47 ` [PATCH v6 2/7] drm/xe/pm: introduce PM PME support Vinod Govindapillai
2026-09-14 20:01   ` sashiko-bot
2026-09-14 19:47 ` [PATCH v6 3/7] drm/xe/pm: avoid reclaim when arming PME wakeup Vinod Govindapillai
2026-09-14 19:47 ` [PATCH v6 4/7] drm/i915: add pme_enabled() to the parent interface Vinod Govindapillai
2026-09-14 19:47 ` [PATCH v6 5/7] drm/i915/xe: plug the pme_enabed implementation for xe Vinod Govindapillai
2026-09-14 19:47 ` [PATCH v6 6/7] drm/i915/irq: conditional HPD IRQ resets based on PME capability Vinod Govindapillai
2026-09-14 20:06   ` sashiko-bot
2026-09-14 19:47 ` [PATCH v6 7/7] drm/i915/hotplug: avoid HPD polling if the device is PME capable Vinod Govindapillai
2026-09-14 19:52 ` ✗ Fi.CI.BUILD: failure for pm_pme support on display hotplug (rev6) Patchwork

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=20260914200026.90F791F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vinod.govindapillai@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.