Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Raag Jadav <raag.jadav@intel.com>, <airlied@gmail.com>,
	<simona@ffwll.ch>,  <lucas.demarchi@intel.com>,
	<rodrigo.vivi@intel.com>, <jani.nikula@linux.intel.com>,
	<andriy.shevchenko@linux.intel.com>, <lina@asahilina.net>,
	<michal.wajdeczko@intel.com>, <christian.koenig@amd.com>
Cc: <intel-xe@lists.freedesktop.org>,
	<intel-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>,
	<aravind.iddamsetty@linux.intel.com>, <anshuman.gupta@intel.com>,
	<alexander.deucher@amd.com>, <andrealmeid@igalia.com>,
	<amd-gfx@lists.freedesktop.org>, <kernel-dev@igalia.com>
Subject: Re: [PATCH v9 3/4] drm/xe: Use device wedged event
Date: Tue, 19 Nov 2024 10:25:10 +0530	[thread overview]
Message-ID: <9249af09-3943-4c72-ab44-08f08ea4807e@intel.com> (raw)
In-Reply-To: <20241115050733.806934-4-raag.jadav@intel.com>



On 15-11-2024 10:37, Raag Jadav wrote:
> This was previously attempted as xe specific reset uevent but dropped
> in commit 77a0d4d1cea2 ("drm/xe/uapi: Remove reset uevent for now")
> as part of refactoring.
> 
> Now that we have device wedged event provided by DRM core, make use
> of it and support both driver rebind and bus-reset based recovery.
> With this in place userspace will be notified of wedged device, on
> the basis of which, userspace may take respective action to recover
> the device.
> 
> $ udevadm monitor --property --kernel
> monitor will print the received events for:
> KERNEL - the kernel uevent
> 
> KERNEL[265.802982] change   /devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:01.0/0000:03:00.0/drm/card0 (drm)
> ACTION=change
> DEVPATH=/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:01.0/0000:03:00.0/drm/card0
> SUBSYSTEM=drm
> WEDGED=rebind,bus-reset
> DEVNAME=/dev/dri/card0
> DEVTYPE=drm_minor
> SEQNUM=5208
> MAJOR=226
> MINOR=0


The patch in itself looks good. Do we have IGT tests in place to 
validate this uevent ?

BR
Himal

> 
> v2: Change authorship to Himal (Aravind)
>      Add uevent for all device wedged cases (Aravind)
> v3: Generic re-implementation in DRM subsystem (Lucas)
> v4: Change authorship to Raag (Aravind)
> 
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_device.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index 0e2dd691bdae..5878b331e35c 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -989,11 +989,12 @@ static void xe_device_wedged_fini(struct drm_device *drm, void *arg)
>    * xe_device_declare_wedged - Declare device wedged
>    * @xe: xe device instance
>    *
> - * This is a final state that can only be cleared with a mudule
> + * This is a final state that can only be cleared with a module
>    * re-probe (unbind + bind).
>    * In this state every IOCTL will be blocked so the GT cannot be used.
>    * In general it will be called upon any critical error such as gt reset
> - * failure or guc loading failure.
> + * failure or guc loading failure. Userspace will be notified of this state
> + * by a DRM uevent.
>    * If xe.wedged module parameter is set to 2, this function will be called
>    * on every single execution timeout (a.k.a. GPU hang) right after devcoredump
>    * snapshot capture. In this mode, GT reset won't be attempted so the state of
> @@ -1023,6 +1024,10 @@ void xe_device_declare_wedged(struct xe_device *xe)
>   			"IOCTLs and executions are blocked. Only a rebind may clear the failure\n"
>   			"Please file a _new_ bug report at https://gitlab.freedesktop.org/drm/xe/kernel/issues/new\n",
>   			dev_name(xe->drm.dev));
> +
> +		/* Notify userspace of wedged device */
> +		drm_dev_wedged_event(&xe->drm,
> +				     DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET);
>   	}
>   
>   	for_each_gt(gt, xe, id)


  parent reply	other threads:[~2024-11-19  4:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15  5:07 [PATCH v9 0/4] Introduce DRM device wedged event Raag Jadav
2024-11-15  5:07 ` [PATCH v9 1/4] drm: Introduce " Raag Jadav
2024-11-18 14:56   ` Aravind Iddamsetty
2024-11-22  7:07     ` Raag Jadav
2024-11-22 10:09       ` Christian König
2024-11-22 16:02         ` Raag Jadav
2024-11-25  5:56           ` Aravind Iddamsetty
2024-11-25 10:27             ` Christian König
2024-11-25  9:32           ` Christian König
2024-11-26  6:38             ` Raag Jadav
2024-11-26  8:12               ` Christian König
2024-11-15  5:07 ` [PATCH v9 2/4] drm/doc: Document " Raag Jadav
2024-11-15  9:19   ` Christian König
2024-11-15 11:44     ` Andy Shevchenko
2024-11-15  5:07 ` [PATCH v9 3/4] drm/xe: Use " Raag Jadav
2024-11-19  3:28   ` Aravind Iddamsetty
2024-11-19  4:55   ` Ghimiray, Himal Prasad [this message]
2024-11-20  7:26     ` Raag Jadav
2024-11-15  5:07 ` [PATCH v9 4/4] drm/i915: " Raag Jadav
2024-11-19  3:43   ` Aravind Iddamsetty
2024-11-15  5:46 ` ✗ Fi.CI.CHECKPATCH: warning for Introduce DRM device wedged event (rev7) Patchwork
2024-11-15  5:46 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-11-15  8:09 ` ✓ Fi.CI.BAT: success " Patchwork
2024-11-15 10:34 ` ✗ Fi.CI.IGT: failure " 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=9249af09-3943-4c72-ab44-08f08ea4807e@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrealmeid@igalia.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=aravind.iddamsetty@linux.intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=kernel-dev@igalia.com \
    --cc=lina@asahilina.net \
    --cc=lucas.demarchi@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=simona@ffwll.ch \
    /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