From: Arun R Murthy <arun.r.murthy@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal.Wajdeczko@intel.com, matthew.d.roper@intel.com,
lucas.demarchi@intel.com, Arun R Murthy <arun.r.murthy@intel.com>
Subject: [PATCHv2] drm/xe: Check for dead config space on reading all 1s
Date: Tue, 19 May 2026 09:01:04 +0530 [thread overview]
Message-ID: <20260519033104.480503-1-arun.r.murthy@intel.com> (raw)
In-Reply-To: <20260512060128.209698-1-arun.r.murthy@intel.com>
After ioremap the BAR mapped address is read once as a sanity check and
if found to be all 1s then return avoiding the driver initialization of
a dead device.
v2: Move the sanity check to mmio_probe_early() - Michal
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7941
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
---
drivers/gpu/drm/xe/xe_mmio.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 78adb303b663..d206e3720eed 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -90,6 +90,7 @@ int xe_mmio_probe_early(struct xe_device *xe)
{
struct xe_tile *root_tile = xe_device_get_root_tile(xe);
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
+ u32 sanity = 0;
/*
* Map the entire BAR.
@@ -103,6 +104,21 @@ int xe_mmio_probe_early(struct xe_device *xe)
return -EIO;
}
+ /*
+ * If the parent PCIe bridge failed to leave D3cold, or the device
+ * fell off the bus, MMIO reads return all-ones. Detect that here
+ * before any other subsystem (SR-IOV, GuC, pcode...) consumes a
+ * bogus 0xFFFFFFFF.
+ */
+ sanity = readl(xe->mmio.regs);
+ if (sanity == U32_MAX && !pci_device_is_present(pdev)) {
+ drm_err(&xe->drm,
+ "MMIO reads all 1s and device not present; aborting probe\n");
+ pci_iounmap(pdev, xe->mmio.regs);
+ xe->mmio.regs = NULL;
+ return -ENODEV;
+ }
+
/* Setup first tile; other tiles (if present) will be setup later. */
xe_mmio_init(&root_tile->mmio, root_tile, xe->mmio.regs, SZ_4M);
--
2.25.1
next prev parent reply other threads:[~2026-05-19 3:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 6:01 [PATCH] drm/xe: Check for dead config space on reading all 1s Arun R Murthy
2026-05-12 11:12 ` ✓ CI.KUnit: success for " Patchwork
2026-05-12 11:55 ` [PATCH] " Michal Wajdeczko
2026-05-12 12:32 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-05-12 22:28 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-19 3:31 ` Arun R Murthy [this message]
2026-05-19 13:24 ` [PATCHv2] " Raag Jadav
2026-05-20 3:52 ` Murthy, Arun R
2026-05-19 20:26 ` Matt Roper
2026-05-20 4:42 ` Murthy, Arun R
2026-05-20 18:07 ` Matt Roper
2026-05-21 4:05 ` Murthy, Arun R
2026-07-06 4:41 ` [PATCHv3] drm/xe: Check for dead config space Arun R Murthy
2026-05-19 3:39 ` ✓ CI.KUnit: success for drm/xe: Check for dead config space on reading all 1s (rev2) Patchwork
2026-05-19 4:21 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-19 13:10 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-07-06 4:49 ` ✓ CI.KUnit: success for drm/xe: Check for dead config space on reading all 1s (rev3) Patchwork
2026-07-06 5:31 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-07-06 7:19 ` ✓ Xe.CI.FULL: success " 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=20260519033104.480503-1-arun.r.murthy@intel.com \
--to=arun.r.murthy@intel.com \
--cc=Michal.Wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.d.roper@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).