intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
	airlied@gmail.com, simona@ffwll.ch, lucas.demarchi@intel.com,
	thomas.hellstrom@linux.intel.com, jani.nikula@linux.intel.com,
	andriy.shevchenko@linux.intel.com,
	joonas.lahtinen@linux.intel.com, tursulin@ursulin.net,
	lina@asahilina.net, intel-xe@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	himal.prasad.ghimiray@intel.com, francois.dugast@intel.com,
	aravind.iddamsetty@linux.intel.com, anshuman.gupta@intel.com,
	andi.shyti@linux.intel.com, matthew.d.roper@intel.com,
	boris.brezillon@collabora.com, adrian.larumbe@collabora.com,
	kernel@collabora.com, maraeo@gmail.com, friedrich.vock@gmx.de,
	michel@daenzer.net, joshua@froggi.es, alexander.deucher@amd.com,
	andrealmeid@igalia.com, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH v7 1/5] drm: Introduce device wedged event
Date: Fri, 18 Oct 2024 15:46:19 +0300	[thread overview]
Message-ID: <ZxJYm6epuuConWdz@black.fi.intel.com> (raw)
In-Reply-To: <5a89757f-7000-4ccc-8762-1befe1fae258@amd.com>

On Fri, Oct 18, 2024 at 12:58:09PM +0200, Christian König wrote:
> Am 17.10.24 um 18:43 schrieb Rodrigo Vivi:
> > On Thu, Oct 17, 2024 at 09:59:10AM +0200, Christian König wrote:
> > > > > Purpose of this implementation is to provide drivers a generic way to
> > > > > recover with the help of userspace intervention. Different drivers may
> > > > > have different ideas of a "wedged device" depending on their hardware
> > > > > implementation, and hence the vendor agnostic nature of the event.
> > > > > It is up to the drivers to decide when they see the need for recovery
> > > > > and how they want to recover from the available methods.
> > > > > 
> > > > > Current implementation defines three recovery methods, out of which,
> > > > > drivers can choose to support any one or multiple of them. Preferred
> > > > > recovery method will be sent in the uevent environment as WEDGED=<method>.
> > > > > Userspace consumers (sysadmin) can define udev rules to parse this event
> > > > > and take respective action to recover the device.
> > > > > 
> > > > >       =============== ==================================
> > > > >       Recovery method Consumer expectations
> > > > >       =============== ==================================
> > > > >       rebind          unbind + rebind driver
> > > > >       bus-reset       unbind + reset bus device + rebind
> > > > >       reboot          reboot system
> > > > >       =============== ==================================
> > > Well that sounds like userspace would need to be involved in recovery.
> > > 
> > > That in turn is a complete no-go since we at least need to signal all
> > > dma_fences to unblock the kernel. In other words things like bus reset needs
> > > to happen inside the kernel and *not* in userspace.
> > > 
> > > What we can do is to signal to userspace: Hey a bus reset of device X
> > > happened, maybe restart container, daemon, whatever service which was using
> > > this device.
> > Well, when we declare device 'wedged' it is because we don't want to take
> > any drastic measures inside the kernel and want to leave it in a protected
> > and unusable state. In a way that users wouldn't lose display for instance,
> > or at least the device is in a debugable state.
> 
> Uff, that needs to be very very well documented or otherwise the whole
> approach is an absolutely clear NAK from my side as DMA-buf maintainer.
> 
> > 
> > Then, the instructions here is to tell what could possibly be attempted
> > from userspace to get the device to an usable state.
> > 
> > The 'wedge' mode (the one emiting this uevent) needs to be responsible
> > for signaling all the fences and everything needed for a clean unbind
> > and whatever next step might be indicated to userspace.
> > 
> > That should already be part of any wedged mode, regardless the uevent
> > to inform the userspace here.
> 
> You need to approach that from a different side. With the current patch set
> you are ignoring documented mandatory driver behavior as far as I can see.
> 
> So first of all describe in the documentation what the wedged mode is and
> what requirements a driver has to fulfill to enter it:
> https://docs.kernel.org/gpu/drm-uapi.html#device-reset
>
> Especially document that all system memory accesses of the device needs to
> be blocked by (for example) disabling DMA accesses in the PCI config space.
> 
> When it is guaranteed that the device can't access any system memory any
> more the device driver should signal all pending fences of this device.
> 
> And only after all of that is done the driver  can send an uevent to inform
> userspace that it can debug the hanged state.

Sure, will do.

> As far as I can see this makes the enum how to recover the device
> superfluous because you will most likely always need a bus reset to get out
> of this again.

That depends on the kind of fault the device has encountered and the bus it is
sitting on. There could be buses that don't support reset.

Raag

  reply	other threads:[~2024-10-18 12:46 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  7:38 [PATCH v7 0/5] Introduce DRM device wedged event Raag Jadav
2024-09-30  7:38 ` [PATCH v7 1/5] drm: Introduce " Raag Jadav
2024-09-30 12:59   ` Andy Shevchenko
2024-10-01  5:08     ` Raag Jadav
2024-10-01 12:07       ` Andy Shevchenko
2024-10-01 14:18         ` Raag Jadav
2024-10-01 14:54           ` Andy Shevchenko
2024-10-01 16:42             ` Raag Jadav
2024-10-01 12:20   ` Michal Wajdeczko
2024-10-03 12:23     ` Raag Jadav
2024-10-08 15:02       ` Raag Jadav
2024-10-10 13:02         ` Lucas De Marchi
2024-10-11  8:47           ` Raag Jadav
2024-10-17  2:47   ` Raag Jadav
2024-10-17  7:59     ` Christian König
2024-10-17 16:43       ` Rodrigo Vivi
2024-10-18 10:58         ` Christian König
2024-10-18 12:46           ` Raag Jadav [this message]
2024-10-18 12:54             ` Christian König
2024-10-18 14:09               ` Raag Jadav
2024-10-17 19:16   ` André Almeida
2024-10-18 14:56     ` Rodrigo Vivi
2024-10-18 15:31       ` Alex Deucher
2024-10-18 17:56         ` André Almeida
2024-10-18 21:07           ` Alex Deucher
2024-10-24 17:48             ` Rodrigo Vivi
2024-10-19 19:08     ` Raag Jadav
2024-09-30  7:38 ` [PATCH v7 2/5] drm: Expose wedge recovery methods Raag Jadav
2024-09-30 13:01   ` Andy Shevchenko
2024-10-01  5:23     ` Raag Jadav
2024-09-30  7:38 ` [PATCH v7 3/5] drm/doc: Document device wedged event Raag Jadav
2024-09-30  7:38 ` [PATCH v7 4/5] drm/xe: Use " Raag Jadav
2024-09-30  7:38 ` [PATCH v7 5/5] drm/i915: " Raag Jadav
2024-09-30  7:47 ` ✗ CI.Patch_applied: failure for Introduce DRM device wedged event (rev5) 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=ZxJYm6epuuConWdz@black.fi.intel.com \
    --to=raag.jadav@intel.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andi.shyti@linux.intel.com \
    --cc=andrealmeid@igalia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=boris.brezillon@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=francois.dugast@intel.com \
    --cc=friedrich.vock@gmx.de \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=joshua@froggi.es \
    --cc=kernel@collabora.com \
    --cc=lina@asahilina.net \
    --cc=lucas.demarchi@intel.com \
    --cc=maraeo@gmail.com \
    --cc=matthew.d.roper@intel.com \
    --cc=michel@daenzer.net \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=tursulin@ursulin.net \
    /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).