From: sashiko-bot@kernel.org
To: "Raag Jadav" <raag.jadav@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 2/2] drm/xe/wedge: Introduce xe_wedge_mode_is_no_reset()
Date: Wed, 18 Nov 2026 15:44:05 +0000 [thread overview]
Message-ID: <sashiko-outbox-221366@kernel.org> (raw)
In-Reply-To: <20261118153154.2024753-3-raag.jadav@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/xe/wedge: wedge_validate_mode() checks current mode instead
of argument
--
commit f022abe900ad7539f9a5e02a0f8c440d6603b312
Author: Raag Jadav <raag.jadav@intel.com>
drm/xe/wedge: Introduce xe_wedge_mode_is_no_reset()
This commit introduces a helper xe_wedge_mode_is_no_reset() and replaces
open-coded XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET checks across the xe
driver.
> diff --git a/drivers/gpu/drm/xe/xe_wedge.c b/drivers/gpu/drm/xe/xe_wedge.c
> index 827fae058976a..3b4c8bee67972 100644
> --- a/drivers/gpu/drm/xe/xe_wedge.c
> +++ b/drivers/gpu/drm/xe/xe_wedge.c
[ ... ]
> @@ -184,7 +184,7 @@ static int wedge_validate_mode(struct xe_device *xe, unsigned int mode)
> if (mode > XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET) {
> xe_dbg(xe, "wedged_mode: invalid value (%u)\n", mode);
> return -EINVAL;
> - } else if (mode == XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET && (IS_SRIOV_VF(xe) ||
> + } else if (xe_wedge_mode_is_no_reset(xe) && (IS_SRIOV_VF(xe) ||
> (IS_SRIOV_PF(xe) && !IS_ENABLED(CONFIG_DRM_XE_DEBUG)))) {
> xe_dbg(xe, "wedged_mode: (%u) %s mode is not supported for %s\n",
> mode, wedge_mode_to_string(mode),
[Severity: High]
Does wedge_validate_mode() check the current xe->wedged.mode via
xe_wedge_mode_is_no_reset(xe) instead of the candidate mode argument?
Because xe_wedge_init() and xe_wedge_set_mode() call wedge_validate_mode()
before updating xe->wedged.mode, setting wedged_mode to
XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET bypasses the SR-IOV check. On an
SR-IOV VF, writing 2 to the wedged_mode debugfs file then proceeds into
wedge_mode_set_reset_policy() -> xe_guc_ads_scheduler_policy_toggle_reset()
and dereferences a NULL ads->bo pointer.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118153154.2024753-1-raag.jadav@intel.com?part=2
prev parent reply other threads:[~2026-11-18 15:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 15:31 [PATCH v2 0/2] Protect drm_ras against unplugged or wedged device Raag Jadav
2026-11-18 15:31 ` [PATCH v2 1/2] drm/xe/drm_ras: Protect " Raag Jadav
2026-11-18 15:31 ` [PATCH v2 2/2] drm/xe/wedge: Introduce xe_wedge_mode_is_no_reset() Raag Jadav
2026-11-18 15:44 ` sashiko-bot [this message]
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-221366@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