intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Murthy, Arun R" <arun.r.murthy@intel.com>
To: "Roper, Matthew D" <matthew.d.roper@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Wajdeczko, Michal" <michal.wajdeczko@intel.com>
Subject: RE: [PATCHv2] drm/xe: Check for dead config space on reading all 1s
Date: Thu, 21 May 2026 04:05:56 +0000	[thread overview]
Message-ID: <IA0PR11MB730701C0FC9C80B656DA30E9BA0E2@IA0PR11MB7307.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20260520180713.GD3379914@mdroper-desk1.amr.corp.intel.com>


> -----Original Message-----
> From: Roper, Matthew D <matthew.d.roper@intel.com>
> Sent: Wednesday, May 20, 2026 11:37 PM
> To: Murthy, Arun R <arun.r.murthy@intel.com>
> Cc: intel-xe@lists.freedesktop.org; Wajdeczko, Michal
> <michal.wajdeczko@intel.com>
> Subject: Re: [PATCHv2] drm/xe: Check for dead config space on reading all 1s
> 
> On Tue, May 19, 2026 at 09:42:36PM -0700, Murthy, Arun R wrote:
> >
> > > -----Original Message-----
> > > From: Roper, Matthew D <matthew.d.roper@intel.com>
> > > Sent: Wednesday, May 20, 2026 1:56 AM
> > > To: Murthy, Arun R <arun.r.murthy@intel.com>
> > > Cc: intel-xe@lists.freedesktop.org; Wajdeczko, Michal
> > > <michal.wajdeczko@intel.com>
> > > Subject: Re: [PATCHv2] drm/xe: Check for dead config space on
> > > reading all 1s
> > >
> > > On Tue, May 19, 2026 at 09:01:04AM +0530, Arun R Murthy wrote:
> > > > 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)) {
> > >
> > > Was the && here intended or was that supposed to be an ||?  I think
> > > if the device isn't "present" the read would _always_ be a failure
> > > and get terminated with ~0?  For that matter, is this the right
> > > place to be checking this?  I guess there can be surprise device
> > > removal at absolultely any time, but the most common time this would
> > > come back as false would be if the device got removed during a
> > > system suspend; the code you're adding here only runs on probe and
> > > not on resume flows.  I think it would be pretty rare to see
> > > pci_device_is_present() already return false here in the probe path
> > > if we just got a successful return from pci_enable_device()?
> > >
> > Sorry should have been ||
> > The reason for having this check over here in early probe is to detect the dead
> config space and return early.
> > This is the scenario that the user is observing in the issue
> > https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/7941
> 
> In that bug, it looks like we already detected and reported the failure to leave
> D3 ("xe 0000:03:00.0: Unable to change power state from D3cold to D0, device
> inaccessible") so it seems like rather than re-checking again here we should just
> have been handling that error and bailing out before we even get to this point?
> 
> 
Ok, will have this sanity in xe_pci_probe and bail out the early probe.

Thanks and Regards,
Arun R Murthy
--------------------

  reply	other threads:[~2026-05-21  4:07 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 ` [PATCHv2] " Arun R Murthy
2026-05-19 13:24   ` 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 [this message]
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=IA0PR11MB730701C0FC9C80B656DA30E9BA0E2@IA0PR11MB7307.namprd11.prod.outlook.com \
    --to=arun.r.murthy@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@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).