Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Missing udev rule line continuation causes the example recovery 
script to execute for every system uevent.
--

--- Patch [3]: [PATCH v10 3/4] drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET 
recovery method ---
commit 38af50f95ad4b618e8f2b464d3185bfdd320b4f3
Author: Mallesh Koujalagi <[email protected]>

drm/doc: Document DRM_WEDGE_RECOVERY_COLD_RESET recovery method
    
This commit documents the cold-reset recovery method for devices that encounter
unrecoverable errors. It provides an example udev rule and shell script to
handle cutting and restoring power to the PCIe slot.

> diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> index 93df92c4ac8cf..43294a10738e6 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}"

[Severity: Medium]
Since udev rules are line-based, does missing a line continuation character
(\) here cause the second line to be parsed as a standalone, unconditional
rule?

If an administrator copies this example verbatim, it appears that
cold-reset.sh might be executed for every single system uevent. While the
script exits early for non-PCI devices, spawning a shell script for every
uevent (add, remove, change, etc.) could cause severe system performance
degradation and boot delays.

> +
> +Recovery script::
> +
> +    #!/bin/sh
> +    die() { echo "ERROR: $*" >&2; exit 1; }
[ ... ]

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to