From: sashiko-bot@kernel.org
To: "Mallesh Koujalagi" <mallesh.koujalagi@intel.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v12 2/4] drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method
Date: Fri, 24 Jul 2026 10:13:39 +0000 [thread overview]
Message-ID: <20260724101340.3EE171F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260724100302.706685-8-mallesh.koujalagi@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The cold-reset recovery script fails to find the hotplug slot for standard single-endpoint PCIe GPUs because it starts its search at the parent bridge, skipping the device itself.
--
--- Patch [2]: [PATCH v12 2/4] drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method ---
commit 40a35f3de596a4e78fa7c7c9f9433ec0c0f1b456
Author: Mallesh Koujalagi <mallesh.koujalagi@intel.com>
drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method
This commit adds documentation for the new "cold-reset" wedge recovery
method. It updates the expectations table and provides an example udev
rule and recovery script to perform a cold reset by removing the device,
toggling slot power, and rescanning the PCI bus.
> diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> index 93df92c4ac8cf..52255247a6db9 100644
> --- a/Documentation/gpu/drm-uapi.rst
> +++ b/Documentation/gpu/drm-uapi.rst
[ ... ]
> @@ -530,6 +542,77 @@ Recovery script::
> echo -n $DEVICE > $DRIVER/unbind
> echo -n $DEVICE > $DRIVER/bind
>
> +Example - cold-reset
> +--------------------
> +
> +Udev rule::
> +
> + SUBSYSTEM=="drm", ENV{WEDGED}=="cold-reset", DEVPATH=="*/drm/card[0-9]", \
> + RUN+="/path/to/cold-reset.sh $env{DEVPATH}"
> +
> +Recovery script::
> +
> + #!/bin/sh
> + die() { echo "ERROR: $*" >&2; exit 1; }
> +
> + [ -n "$1" ] || die "Usage: $0 <device-path>"
> +
> + PCI_DEVS=/sys/bus/pci/devices
> + PCI_SLOTS=/sys/bus/pci/slots
> +
> + syspath=$(readlink -f "/sys/$1/device" 2>/dev/null || readlink -f "/sys/$1" 2>/dev/null)
> + [ -n "$syspath" ] || die "cannot resolve sysfs path for: $1"
> +
> + dev=$(basename "$syspath")
> + [ -e "$PCI_DEVS/$dev" ] || die "not a PCI device: $dev"
> + echo "device : $dev"
> +
> + slot=""
> + walk=$(dirname "$(readlink -f "$PCI_DEVS/$dev")")
[Severity: Medium]
Will this fail to find the hotplug slot for standard single-endpoint PCIe GPUs?
By initializing walk with dirname here, the script appears to start its search
at the parent bridge, skipping the device itself. Since the device's own
address typically matches the hotplug slot address, this skips checking the
device's slot and will result in no hotplug slot being found for single
endpoint devices.
> +
> + while true; do
> + ancestor=$(basename "$walk")
> + case "$ancestor" in pci*) break ;; esac # reached the virtual bus root
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724100302.706685-6-mallesh.koujalagi@intel.com?part=2
next prev parent reply other threads:[~2026-07-24 10:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 10:03 [PATCH v12 0/4] Introduce cold reset recovery method Mallesh Koujalagi
2026-07-24 10:03 ` [PATCH v12 1/4] drm: Add DRM_WEDGE_RECOVERY_COLD_RESET " Mallesh Koujalagi
2026-07-24 10:16 ` sashiko-bot
2026-07-24 10:03 ` [PATCH v12 2/4] drm/doc: Document " Mallesh Koujalagi
2026-07-24 10:13 ` sashiko-bot [this message]
2026-07-24 10:03 ` [PATCH v12 3/4] drm/xe: Handle PUNIT errors by requesting cold-reset recovery Mallesh Koujalagi
2026-07-24 10:29 ` sashiko-bot
2026-07-24 10:03 ` [PATCH v12 4/4] drm/xe/ras: Use fault-inject to trigger punit error handler Mallesh Koujalagi
2026-07-24 10:20 ` sashiko-bot
2026-07-28 8:32 ` Tauro, Riana
2026-07-28 19:25 ` 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=20260724101340.3EE171F00A3E@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