All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Thomas Zimmermann" <tzimmermann@suse.de>
Cc: intel-gfx@lists.freedesktop.org,
	wsa+renesas@sang-engineering.com, Frank.Li@kernel.org,
	linux-hyperv@vger.kernel.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, ojeda@kernel.org,
	imx@lists.linux.dev
Subject: Re: [PATCH v2 07/13] drm/panic: Retry in dispatch function if panic output fails
Date: Mon, 24 Aug 2026 13:21:18 +0000	[thread overview]
Message-ID: <20260824132119.0027B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824125201.218863-8-tzimmermann@suse.de>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The commit message claims a change that is not present in the code diff.
- [Medium] Fallback to user mode silently flushes a blank screen if the screen is narrower than a single character, defeating failure preservation.
--

--- Patch [7]: [PATCH v2 07/13] drm/panic: Retry in dispatch function if panic output fails ---
commit 43648cf544bdeed6f6c85be5e74f3e855c778814
Author: Thomas Zimmermann <tzimmermann@suse.de>

drm/panic: Retry in dispatch function if panic output fails

This patch introduces explicit fallback to DRM_PANIC_TYPE_USER in
drm_panic_dispatch() when QR code or kmsg outputs fail. It also increases the
minimum QR code test size to 494x494.

> Also pass module parameter drm_panic_type as a parameter to
> drm_panic_dispatch(). This simpifies the implementation. It will later
> allow for moving the function into a helper library.

[Severity: Medium]
This isn't a bug, but the commit message mentions passing drm_panic_type as a
parameter to drm_panic_dispatch(), which isn't present in this patch's code
changes. Was this already implemented in a preceding commit?

> diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
> index f597ef04c5bcb..bc7c096c42363 100644
> --- a/drivers/gpu/drm/drm_panic.c
> +++ b/drivers/gpu/drm/drm_panic.c

[ ... ]

> @@ -895,13 +886,22 @@ static int draw_panic_dispatch(struct drm_scanout_buffer *sb, enum drm_panic_typ
>  {
>  	int ret;
>  
> +retry:
>  	switch (panic_type) {
>  	case DRM_PANIC_TYPE_KMSG:
>  		ret = draw_panic_screen_kmsg(sb, fg_color, bg_color);
> +		if (ret) {
> +			panic_type = DRM_PANIC_TYPE_USER;
> +			goto retry;
> +		}

[Severity: Medium]
Does this fallback logic inadvertently cause the screen to be overwritten with
a blank screen if the screen is narrower than a single character?

If drm_panic_type is set to KMSG and sb->width < font->width,
draw_panic_screen_kmsg() returns -EINVAL. The retry logic here catches this
and falls back to DRM_PANIC_TYPE_USER.

However, looking at draw_panic_screen_user(), it lacks a similar width check.
It clears the screen with the background color:

drivers/gpu/drm/drm_panic.c:draw_panic_screen_user() {
    ...
    /* Fill with the background color, and draw text on top */
    drm_panic_fill(sb, &r_screen, bg_color);
    ...
}

It then returns 0 (success) without drawing any text. This success code causes
draw_panic_plane() to flush the blank screen, destroying the existing visual
evidence instead of preserving it.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824125201.218863-1-tzimmermann@suse.de?part=7

  reply	other threads:[~2026-08-24 13:21 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 12:43 [PATCH v2 00/13] drm/panic: Split into core and helpers Thomas Zimmermann
2026-08-24 12:43 ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 01/13] drm/panic: Do not use un-escaped URL as format string Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 02/13] drm/panic: Test address from kmap op for NULL Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 03/13] drm/panic: Return -EINVAL if font is not available Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 04/13] drm/panic: Return errno codes if panic output fails Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 13:15   ` sashiko-bot
2026-08-24 12:43 ` [PATCH v2 05/13] drm/panic: Pass colors to draw_panic_dispatch() Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 13:13   ` sashiko-bot
2026-08-24 12:43 ` [PATCH v2 06/13] drm/panic: Pass global module parameters to drm_panic_dispatch() Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 07/13] drm/panic: Retry in dispatch function if panic output fails Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 13:21   ` sashiko-bot [this message]
2026-08-24 12:43 ` [PATCH v2 08/13] drm/panic: Split draw_panic_plane() Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 09/13] drm/panic: Restrict to primary planes; unconditionally unregister Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 13:31   ` sashiko-bot
2026-08-24 12:43 ` [PATCH v2 10/13] drm/panic: Display panic screen via per-plane callback Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 11/13] drm/panic: Internalize panic locking in DRM core and helpers Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 12/13] drm/panic: Move panic display code into helper library Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 12:43 ` [PATCH v2 13/13] drm/panic: Compile KUnit tests as module Thomas Zimmermann
2026-08-24 12:43   ` Thomas Zimmermann
2026-08-24 14:11   ` sashiko-bot
2026-08-24 16:29 ` ✓ i915.CI.BAT: success for drm/panic: Split into core and helpers (rev2) 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=20260824132119.0027B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=imx@lists.linux.dev \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tzimmermann@suse.de \
    --cc=wsa+renesas@sang-engineering.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.