From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/xe/xe_pci_error: Wait for pcode init post SBR
Date: Fri, 28 Aug 2026 11:41:54 +0000 [thread overview]
Message-ID: <20260828114154.EFCE91F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828113104.319843-5-riana.tauro@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Data Race / Missing Mutual Exclusion in PCODE mailbox access during PCI error recovery
--
commit 6f04a64effec675eee1b5da08bc2d84a4196d4ed
Author: Riana Tauro <riana.tauro@intel.com>
drm/xe/xe_pci_error: Wait for pcode init post SBR
This commit adds a wait for Pcode initialization before accessing the
device post Secondary Bus Reset (SBR) in xe_pci_error_slot_reset().
> diff --git a/drivers/gpu/drm/xe/xe_pci_error.c b/drivers/gpu/drm/xe/xe_pci_error.c
> index 79ce0c671549a..3e9c77f8483d6 100644
> --- a/drivers/gpu/drm/xe/xe_pci_error.c
> +++ b/drivers/gpu/drm/xe/xe_pci_error.c
> @@ -109,6 +110,10 @@ static pci_ers_result_t xe_pci_error_slot_reset(struct pci_dev *pdev)
> return PCI_ERS_RESULT_DISCONNECT;
> }
>
> + err = xe_pcode_probe_early(xe);
> + if (err)
> + return PCI_ERS_RESULT_DISCONNECT;
> +
[Severity: High]
Does this code introduce a data race in PCODE mailbox access during PCI error
recovery?
xe_pcode_probe_early() calls xe_pcode_ready() without locking:
drivers/gpu/drm/xe/xe_pcode.c:xe_pcode_probe_early() {
return xe_pcode_ready(xe, false);
}
The false argument explicitly disables tile->pcode.lock acquisition. However,
at this point in xe_pci_error_slot_reset(), the userspace interfaces like
hwmon sysfs are still registered and accessible.
If a userspace process reads hwmon sysfs limits (e.g., power1_max_interval)
while PCI error recovery is executing, the sysfs read will legitimately
acquire tile->pcode.lock and access PCODE. Meanwhile, this function will
bypass the lock and execute concurrent MMIO accesses to the same PCODE
registers.
Can this lead to hardware state machine corruption and the execution of
malformed commands by the PCODE microcontroller? Hwmon read handlers do not
check the wedged.flag, and sysfs interfaces are not removed until later
when pdev->driver->remove(pdev) is called.
> /*
> * Secondary Bus Reset causes all VRAM state to be lost along with
> * hardware state. As an initial step, re-probe the device to
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828113104.319843-4-riana.tauro@intel.com?part=1
next prev parent reply other threads:[~2026-08-28 11:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 11:31 [PATCH 0/2] Xe Pci error handling fixes Riana Tauro
2026-08-28 11:31 ` [PATCH 1/2] drm/xe/xe_pci_error: Wait for pcode init post SBR Riana Tauro
2026-08-28 11:41 ` sashiko-bot [this message]
2026-08-28 14:06 ` Gupta, Anshuman
2026-08-29 14:00 ` Raag Jadav
2026-08-31 12:32 ` Aravind Iddamsetty
2026-09-03 12:53 ` Gupta, Anshuman
2026-08-28 11:31 ` [PATCH 2/2] drm/xe/xe_guc: Skip GuC reset " Riana Tauro
2026-08-28 11:44 ` sashiko-bot
2026-09-03 16:34 ` Teres Alexis, Alan Previn
2026-08-28 11:38 ` ✓ CI.KUnit: success for Xe Pci error handling fixes Patchwork
2026-08-28 12:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-28 13:30 ` ✓ Xe.CI.FULL: " 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=20260828114154.EFCE91F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=riana.tauro@intel.com \
--cc=sashiko-reviews@lists.linux.dev \
/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;
as well as URLs for NNTP newsgroup(s).