From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v11 1/3] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET recovery method
Date: Mon, 20 Jul 2026 10:30:37 +0000 [thread overview]
Message-ID: <20260720103037.960D81F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260720101815.526813-6-mallesh.koujalagi@intel.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Low] The newly introduced `cold-reset` uAPI string is missing from the official device wedging documentation.
Pre-existing issues:
- [High] The `event_string` buffer used for the uevent is too small to hold multiple wedge recovery methods, leading to silent truncation and malformed uevent strings being sent to userspace.
--
--- Patch [1]: [PATCH v11 1/3] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET recovery method ---
commit 187c2c07431486fea095780d51c31e9abe6dc614
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
drm: Add DRM_WEDGE_RECOVERY_COLD_RESET recovery method
Introduce DRM_WEDGE_RECOVERY_COLD_RESET (BIT(4)) recovery method to handle
scenarios requiring device power cycle.
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 1ff0bf7cba6aa..94abe7a811a52 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -537,6 +537,8 @@ static const char *drm_get_wedge_recovery(unsigned int opt)
> return "bus-reset";
> case DRM_WEDGE_RECOVERY_VENDOR:
> return "vendor-specific";
> + case DRM_WEDGE_RECOVERY_COLD_RESET:
> + return "cold-reset";
[Severity: High]
This is a pre-existing issue, but is the WEDGE_STR_LEN buffer large enough
to hold all combinations now that a new recovery method is added?
In drivers/gpu/drm/drm_drv.c:drm_dev_wedged_event():
#define WEDGE_STR_LEN 32
...
len = scnprintf(event_string, sizeof(event_string), "%s", "WEDGED=");
...
len += scnprintf(event_string + len, sizeof(event_string) - len,
"%s,", recovery);
...
if (recovery)
/* Get rid of trailing comma */
event_string[len - 1] = '\0';
If a device enters an unrecoverable state with multiple flags set
(like DRM_WEDGE_RECOVERY_REBIND | DRM_WEDGE_RECOVERY_BUS_RESET |
DRM_WEDGE_RECOVERY_COLD_RESET), the string representation exceeds the 32 byte
limit of event_string.
Because scnprintf caps the write, the trailing comma removal logic will
inadvertently overwrite the last valid character, leading to a malformed
uevent string being sent to userspace (e.g., WEDGED=rebind,bus-reset,cold-r).
Could this prevent userspace parsers from recognizing the method?
> default:
> return NULL;
> }
> diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
> index 768a8dae83c52..75f030d027ee4 100644
> --- a/include/drm/drm_device.h
> +++ b/include/drm/drm_device.h
> @@ -37,6 +37,7 @@ struct pci_controller;
> #define DRM_WEDGE_RECOVERY_REBIND BIT(1) /* unbind + bind driver */
> #define DRM_WEDGE_RECOVERY_BUS_RESET BIT(2) /* unbind + reset bus device + bind */
> #define DRM_WEDGE_RECOVERY_VENDOR BIT(3) /* vendor specific recovery method */
> +#define DRM_WEDGE_RECOVERY_COLD_RESET BIT(4) /* remove device + slot power cycle + rescan */
[Severity: Low]
Should this newly introduced cold-reset method also be added to the uAPI
documentation?
The device wedging documentation in Documentation/gpu/drm-uapi.rst lists
consumer expectations for other methods (none, rebind, bus-reset,
vendor-specific, unknown), but cold-reset is currently missing.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720101815.526813-5-mallesh.koujalagi@intel.com?part=1
next prev parent reply other threads:[~2026-07-20 10:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 10:18 [PATCH v11 0/3] Introduce cold reset recovery method Mallesh Koujalagi
2026-07-20 10:18 ` [PATCH v11 1/3] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET " Mallesh Koujalagi
2026-07-20 10:30 ` sashiko-bot [this message]
2026-07-20 10:18 ` [PATCH v11 2/3] drm/doc: Document " Mallesh Koujalagi
2026-07-20 10:18 ` [PATCH v11 3/3] drm/xe: Handle PUNIT errors by requesting cold-reset recovery Mallesh Koujalagi
2026-07-20 10:48 ` sashiko-bot
2026-07-21 17:37 ` Rodrigo Vivi
[not found] ` <amHzsHmNSH84SZ92@black.igk.intel.com>
2026-07-23 14:03 ` [PATCH v11 0/3] Introduce cold reset recovery method Rodrigo Vivi
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=20260720103037.960D81F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=mallesh.koujalagi@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