Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Raag Jadav" <raag.jadav@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v12 9/9] drm/xe/ras: Move xe_ras_process_errors() to xe_ras
Date: Mon, 19 Oct 2026 02:48:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-176550@kernel.org> (raw)
In-Reply-To: <20261019023708.128835-10-raag.jadav@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/xe/ras: early wedging in xe_ras_init() breaks probe and wedged uevent
--

commit 8cceca0f947439603841861a5aee7e3dd4918b92
Author: Raag Jadav <raag.jadav@intel.com>

drm/xe/ras: Move xe_ras_process_errors() to xe_ras

This commit moves the boot-time xe_ras_process_errors() call from the end of
xe_device_probe() back into xe_ras_init(), reverting commit 20bc4883c7c0
("drm/xe/ras: Fix boot-time ras error processing") now that xe_wedge_fini()
is registered in xe_device_probe_early().

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 0072bb4cc5dfe..db3cbc186a514 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -1212,6 +1212,13 @@ int xe_ras_init(struct xe_device *xe)
>  	get_offline_list(xe);
>  	get_offline_queue(xe);
>  
> +	/*
> +	 * During probe, process and log any errors detected by firmware while the driver was not
> +	 * loaded. Critical errors such as Punit and CSC are reported through Pcode init failure,
> +	 * causing the driver to enter survivability mode.
> +	 */
> +	xe_ras_process_errors(xe);

[Severity: High]
Can calling xe_ras_process_errors() inside xe_ras_init() break driver probe
and wedged uevent delivery when an error triggers device wedging?

In xe_ras_process_errors(), a boot-time CSC firmware error or Punit IEH error
in handle_soc_internal_errors(), or cold-reset wedge fault injection via
xe_fault_wedge_cold_reset(), calls into xe_wedge_declare():

xe_ras_process_errors()
  -> handle_soc_internal_errors() / punit_error_handler()
     -> xe_survivability_mode_runtime_enable() / punit_error_handler()
        -> xe_wedge_declare()

In xe_device_probe(), xe_ras_init() runs before xe_gt_init() and
drm_dev_register():

drivers/gpu/drm/xe/xe_device.c:xe_device_probe() {
	...
	err = xe_ras_init(xe);
	if (err)
		return err;
	...
	for_each_gt(gt, xe, id) {
		err = xe_gt_init(gt);
		if (err)
			return err;
	}
	...
	err = drm_dev_register(&xe->drm, 0);
	if (err)
		return err;
}

When xe_wedge_declare() runs during xe_ras_init(), it sets xe->wedged.flag to
1 and schedules xe->wedged.work.

First, when xe_device_probe() subsequently calls xe_gt_init() ->
gt_init_with_all_forcewake() -> xe_uc_load_hw(), GuC CT communication checks
xe_wedged() in __guc_ct_send_locked() and g2h_read():

drivers/gpu/drm/xe/xe_guc_ct.c:__guc_ct_send_locked() {
	if (xe_wedged(ct_to_xe(ct))) {
		ret = -ENOTRECOVERABLE;
		goto out;
	}
}

Because xe_wedged() is already true, GuC initialization steps such as
xe_gt_record_default_lrcs() and xe_guc_post_load_init() fail with
-ENOTRECOVERABLE. Doesn't this abort xe_gt_init() and xe_device_probe(),
unbinding the driver and tearing down the runtime survivability sysfs files
created by xe_survivability_mode_runtime_enable() instead of keeping the
device bound in wedged mode?

Second, xe_wedge_declare() schedules wedge_work(), which calls
drm_dev_wedged_event(&xe->drm, xe->wedged.method, NULL) to emit a KOBJ_CHANGE
uevent on xe->drm.primary->kdev->kobj. Since drm_dev_register() ->
drm_minor_register() -> device_add() has not run yet, won't this attempt to
send the uevent before the primary DRM minor device is registered in sysfs?

Also, since xe_ras_init() returns early when !xe->info.has_sysctrl, doesn't
moving xe_ras_process_errors() after that check bypass the
xe_fault_wedge_cold_reset() fault-injection path on platforms without
has_sysctrl?

> +
>  	ret = devm_device_add_group(xe->drm.dev, &gpu_health_group);
>  	if (ret)
>  		xe_err(xe, "Failed to create GPU health sysfs, err=%d\n", ret);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261019023708.128835-1-raag.jadav@intel.com?part=9

  reply	other threads:[~2026-10-19  2:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  2:36 [PATCH v12 0/9] Introduce xe_wedge Raag Jadav
2026-10-19  2:36 ` [PATCH v12 1/9] drm/xe/gt: Use GT ordered workqueue for wedging Raag Jadav
2026-10-19  3:18   ` sashiko-bot
2026-10-19  2:36 ` [PATCH v12 2/9] drm/xe: Drop xe_device_set_wedged_method() Raag Jadav
2026-10-19  2:36 ` [PATCH v12 3/9] drm/xe/hw_error: Guard csc_hw_error_work() with runtime PM Raag Jadav
2026-10-19  2:36 ` [PATCH v12 4/9] drm/xe: Move xe_device_wedged_fini() registration to xe_device_probe_early() Raag Jadav
2026-10-19  2:36 ` [PATCH v12 5/9] drm/xe: Make xe_device_declare_wedged() IRQ safe Raag Jadav
2026-10-19  2:36 ` [PATCH v12 6/9] drm/xe/pci_error: Flush GT wedge worker before bus reset Raag Jadav
2026-10-19  2:36 ` [PATCH v12 7/9] drm/xe/amc: Guard xe_amc_work() with runtime PM Raag Jadav
2026-10-19  2:36 ` [PATCH v12 8/9] drm/xe: Introduce xe_wedge Raag Jadav
2026-10-19  2:36 ` [PATCH v12 9/9] drm/xe/ras: Move xe_ras_process_errors() to xe_ras Raag Jadav
2026-10-19  2:48   ` sashiko-bot [this message]
2026-10-19  7:18 ` ✗ CI.checkpatch: warning for Introduce xe_wedge (rev11) Patchwork
2026-10-19  7:20 ` ✓ CI.KUnit: success " Patchwork
2026-10-19  8:01 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-19  9:27 ` ✗ Xe.CI.FULL: 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=sashiko-outbox-176550@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=raag.jadav@intel.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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