Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Riana Tauro" <riana.tauro@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v4 1/3] drm/xe/ras: Wedge the device on page offline failure in all callers
Date: Thu, 26 Nov 2026 09:02:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-235070@kernel.org> (raw)
In-Reply-To: <20261126083516.1932195-6-riana.tauro@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/xe/ras: early wedge in handle_page_offline() aborts
  xe_device_probe()
--

commit f2101da39ac6227266b370d84f804f3c854b3469
Author: Riana Tauro <riana.tauro@intel.com>

drm/xe/ras: Wedge the device on page offline failure in all callers

This commit moves the xe_wedge_declare() call for page offline failures
from handle_device_memory_errors() into handle_page_offline() so that all
callers declare the device wedged on -EIO and -ENOMEM.

> diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> index 9b04be3405ca7..c30cea4901cbd 100644
> --- a/drivers/gpu/drm/xe/xe_ras.c
> +++ b/drivers/gpu/drm/xe/xe_ras.c
> @@ -347,7 +347,7 @@ static int handle_page_offline(struct xe_device *xe, u64 page_address, bool noti
>  		break;
>  	case -EIO:
>  		xe_err(xe, "[RAS]: Page address 0x%llx belongs to critical BO\n", page_address);
> -		return ret;
> +		break;
>  	case -EEXIST:
>  		xe_dbg(xe, "[RAS]: Repeated error on already soft-offlined page address 0x%llx\n",
>  		       page_address);
> @@ -355,15 +355,24 @@ static int handle_page_offline(struct xe_device *xe, u64 page_address, bool noti
>  			action = XE_RAS_PAGE_ACTION_REMOVE;
>  		else
>  			action = XE_RAS_PAGE_ACTION_OFFLINE;
> -		break;
> +		goto notify;
>  	case -ENOMEM:
> +		break;
>  	default:
>  		xe_err(xe, "[RAS]: Failed to offline page address 0x%llx: %d\n", page_address, ret);
> -		/* Only allocation failure is propagated, other errors are not actionable */
> -		return ret == -ENOMEM ? ret : 0;
> +		return 0;
>  	}
>  
> - notify:
> +	/*
> +	 * Wedge the device with a bus reset for critical BO's and memory unavailability.
> +	 * TODO: Trigger SBR using pci_reset_bus
> +	 */
> +	if (ret) {
> +		xe_wedge_declare(xe, DRM_WEDGE_RECOVERY_BUS_RESET);
> +		return ret;
> +	}

[Severity: High]
Can calling xe_wedge_declare() here during xe_ras_init() abort
xe_device_probe() instead of leaving the device bound in a wedged state?

xe_device_probe() calls xe_ras_init() -> get_offline_list() /
get_offline_queue() -> process_offline_pages() -> handle_page_offline()
before xe_gt_init() and drm_dev_register().  If firmware reports a page in
the stolen/GSM/CCS region (-EIO) or allocation fails (-ENOMEM),
xe_wedge_declare() sets xe->wedged.perm = 1.  When xe_device_probe() later
runs xe_gt_init() -> xe_uc_load_hw(), __guc_ct_send_locked() checks
xe_wedged_permanent() and fails with -ENOTRECOVERABLE, tearing down the
device before the DRM device is registered to deliver the wedged uevent.

In addition, process_offline_pages() ignores the return value of
handle_page_offline() and still records the failed address as
XE_RAS_PAGE_OFFLINED in state->offlined_pages when notify_fw is false:

drivers/gpu/drm/xe/xe_ras.c:process_offline_pages() {
    ...
		for (i = 0; i < common->pages_returned && i < XE_RAS_NUM_PAGES; i++) {
			handle_page_offline(xe, common->page_addresses[i], notify_fw);
			/* The pages are already offlined by firmware */
			if (!notify_fw) {
				index = common->page_addresses[i] >> XE_PTE_SHIFT;
				ret = xa_err(xa_store(&state->offlined_pages, index,
						      XE_RAS_PAGE_OFFLINED, GFP_KERNEL));
    ...
}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261126083516.1932195-5-riana.tauro@intel.com?part=1

  reply	other threads:[~2026-11-26  9:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26  8:35 [PATCH v4 0/3] Handle sysctrl event for page offline full Riana Tauro
2026-11-26  8:35 ` [PATCH v4 1/3] drm/xe/ras: Wedge the device on page offline failure in all callers Riana Tauro
2026-11-26  9:02   ` sashiko-bot [this message]
2026-11-26  8:35 ` [PATCH v4 2/3] drm/xe/sysctrl: Drain page offline queue on queue-full event Riana Tauro
2026-11-26  8:52   ` sashiko-bot
2026-11-26  8:35 ` [PATCH v4 3/3] drm/xe/ras: Skip offline queue processing after device unplug Riana Tauro
2026-11-26  8:46   ` sashiko-bot
2026-11-26  8:49     ` Tauro, Riana
2026-11-26  9:25   ` Raag Jadav
2026-11-26  9:40     ` Tauro, Riana
2026-11-26  8:43 ` ✗ CI.checkpatch: warning for Handle sysctrl event for page offline full Patchwork
2026-11-26  8:45 ` ✓ CI.KUnit: success " Patchwork
2026-11-26  9:27 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-26 14:29 ` ✓ Xe.CI.FULL: " 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-235070@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=riana.tauro@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