Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Soham Purkait" <soham.purkait@intel.com>,
	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining
Date: Thu, 03 Dec 2026 13:42:40 +0000	[thread overview]
Message-ID: <sashiko-outbox-247875@kernel.org> (raw)
In-Reply-To: <20261203131610.1375755-5-soham.purkait@intel.com>

Thank you for your contribution! Sashiko AI review found 3 potential
issues to consider:
- [Medium] drm/xe/ras: handle_device_memory_errors() requests reset on
  full offline list
- [Medium] drm/xe/ras: send_page_offline_cmd() wedges before
  drm_dev_register()
- [Low] drm/xe/ras: commit message names OUT_OF_RESOURCES instead of
  actual status
--

commit 950318c0654d4d72359d087413eebbadfa126d78
Author: Soham Purkait <soham.purkait@intel.com>

drm/xe/ras: Wedge device if page offline list is full during offlining

This commit declares the device wedged with recovery method 0 when
send_page_offline_cmd() receives XE_RAS_STATUS_INSUFFICIENT_RESOURCES from
the system controller firmware.

> When a page offline request is sent to the firmware, it response with
> OUT_OF_RESOURCES if its offline list in flash is full and cannot hold
> any more pages.

[Severity: Low]
The commit message names OUT_OF_RESOURCES, while the code checks
XE_RAS_STATUS_INSUFFICIENT_RESOURCES (and OUT_OF_RESOURCES does not exist
in drivers/gpu/drm/xe).  Should the commit message be updated to match?

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 9b04be3405ca7..b65c4ef42e459 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -291,6 +291,10 @@ static int send_page_offline_cmd(struct xe_device *xe, u64 page_address,
>  	if (ret) {
>  		xe_err(xe, "sysctrl: page offline command failed with status %#x\n",
>  		       response.status);
> +		if (response.status == XE_RAS_STATUS_INSUFFICIENT_RESOURCES) {
> +			xe_err(xe, "[RAS]: page offline list is full\n");
> +			xe_wedge_declare(xe, 0);
> +		}
>  		return ret;
>  	}

[Severity: Medium]
Should handle_device_memory_errors() return
XE_RAS_RECOVERY_ACTION_DISCONNECT when send_page_offline_cmd() returns
-ENOSPC, instead of requesting a bus reset?

send_page_offline_cmd() wedges the device with recovery method 0 and returns
-ENOSPC, which handle_page_offline() propagates to
handle_device_memory_errors():

drivers/gpu/drm/xe/xe_ras.c:handle_device_memory_errors() {
	...
	if (ret) {
		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_BUS_RESET);
		return XE_RAS_RECOVERY_ACTION_RESET;
	}
}

Under XE_WEDGED_MODE_NEVER, xe_wedge_declare() returns without setting
xe->wedged.perm.  ras_action_to_pci_result() then calls
prepare_device_for_reset() -> xe_gt_wedge_declare() (hitting
xe_gt_assert(gt, xe->wedged.mode)) and returns PCI_ERS_RESULT_NEED_RESET.

Even under the default wedge mode, if an earlier error in the same
xe_ras_process_errors() batch already wedged with
DRM_WEDGE_RECOVERY_BUS_RESET, xe_wedge_declare(xe, 0) is silently ignored.

[Severity: Medium]
Can xe_wedge_declare(xe, 0) run during probe before drm_dev_register()?

xe_device_probe() calls xe_ras_init() -> get_offline_queue() ->
process_offline_pages() -> handle_page_offline() -> send_page_offline_cmd()
before drm_dev_register() adds dev->primary->kdev.  When probe subsequently
fails, devres teardown races with wedge_work():

CPU0 (probe)                     CPU1 (kworker)
xe_device_probe()
  xe_ras_init()
    ...
    send_page_offline_cmd()
      xe_wedge_declare(xe, 0)
        schedule_work(...)
  ... (probe fails before
       drm_dev_register())
                                 wedge_work()
                                   drm_dev_wedged_event()
                                     kobject_uevent_env(...)
                                       <-- DEVPATH=/cardN (unregistered)
  drm_dev_put()
    xe_wedge_fini()
      disable_work_sync(...)

If wedge_work() runs first, dev->primary->kdev has only been initialized by
drm_sysfs_minor_alloc() and has a NULL parent, so drm_dev_wedged_event()
emits a KOBJ_CHANGE uevent with DEVPATH=/cardN without any prior KOBJ_ADD
and without matching standard DRM udev rules.

If disable_work_sync() in xe_wedge_fini() runs first during probe teardown,
the WEDGED=unknown uevent is silently dropped.

Note that commit 20bc4883c7c0 ("drm/xe/ras: Fix boot-time ras error
processing") previously moved xe_ras_process_errors() to avoid wedging
before DRM device registration, and commit "drm/xe/ras: Wedge device if page
offline list is full at probe" still aborts probe before drm_dev_register().

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203131610.1375755-4-soham.purkait@intel.com?part=1

  reply	other threads:[~2026-12-03 13:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 13:16 [PATCH v3 0/2] Wedge device if page offline list is full Soham Purkait
2026-12-03 13:16 ` [PATCH v3 1/2] drm/xe/ras: Wedge device if page offline list is full during offlining Soham Purkait
2026-12-03 13:42   ` sashiko-bot [this message]
2026-12-03 13:16 ` [PATCH v3 2/2] drm/xe/ras: Wedge device if page offline list is full at probe Soham Purkait
2026-12-03 13:38   ` sashiko-bot
2026-12-03 13:25 ` ✓ CI.KUnit: success for Wedge device if page offline list is full (rev3) Patchwork
2026-12-03 13:59 ` ✓ Xe.CI.BAT: " 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=sashiko-outbox-247875@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=soham.purkait@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