mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jocelyn Falempe <jfalempe@redhat.com>
To: Devin Wittmayer <lucid_duck@justthetip.ca>,
	Javier Martinez Canillas <javierm@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	desobei <desobei@outlook.com>, luyuantao <luyuantao@kylinos.cn>
Subject: Re: [PATCH] drm/panic: Bring back the kmsg screen fixes lost in a merge
Date: Fri, 20 Nov 2026 15:34:57 +0100	[thread overview]
Message-ID: <dc4518d6-c62c-428a-94a2-39c84cafc83a@redhat.com> (raw)
In-Reply-To: <20261119191038.146963-1-lucid_duck@justthetip.ca>

On 11/19/26 20:10, Devin Wittmayer wrote:
> Commit b537d87d2632 ("drm/panic: Fix the loop that causes kmsg to not
> display correctly") and commit 1ba640563843 ("drm/panic: Fix kmsg screen
> hang on a long log line") changed the old panic file. By the time they
> reached drm-fixes, that code had moved into the helper library, and the
> merge left the helper as it was.
> 
> So the panic screen that prints the kernel log hangs again on a long
> log line, and the machine never reboots. The helper's KUnit suite hangs
> the same way.
> 
> Make both changes in the helper.

Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>

So I'll push it again to drm-misc-next.

-- 

Jocelyn
> 
> Fixes: 5c3d323984fd ("drm/panic: Move panic display code into helper library")
> Reported-by: desobei <desobei@outlook.com>
> Closes: https://lore.kernel.org/all/PH7PR19MB6658FDBDD012399C6E8D330FAF792@PH7PR19MB6658.namprd19.prod.outlook.com/
> Tested-by: desobei <desobei@outlook.com>
> Cc: luyuantao <luyuantao@kylinos.cn>
> Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
> ---
> Both were lost in merge 1c3b1398f1cf. My other fix in that pull, for
> the panic screen setting, made it through.
> 
> Panics with a long line in the log, on drm-misc-fixes:
> 
>                                without this    with this
>      QEMU, 40 panics           all hang        all reboot
>      AMD mini PC, 8 panics     all hang        all reboot
> 
> Panics with nothing long in the log reboot either way.
> 
>   drivers/gpu/drm/drm_panic_helper.c | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_panic_helper.c b/drivers/gpu/drm/drm_panic_helper.c
> index 8913c3d22e8d..385a07ed314b 100644
> --- a/drivers/gpu/drm/drm_panic_helper.c
> +++ b/drivers/gpu/drm/drm_panic_helper.c
> @@ -513,7 +513,8 @@ VISIBLE_IF_KUNIT int drm_panic_helper_draw_screen_kmsg(struct drm_scanout_buffer
>   	const struct font_desc *font = get_default_font(sb->width, sb->height, NULL, NULL);
>   	struct drm_rect r_screen = DRM_RECT_INIT(0, 0, sb->width, sb->height);
>   	struct kmsg_dump_iter iter;
> -	char kmsg_buf[512];
> +	/* the size printk formats one record into, too big for the stack */
> +	static char kmsg_buf[2048];
>   	size_t kmsg_len;
>   	struct drm_panic_line line;
>   	int yoffset;
> @@ -530,10 +531,15 @@ VISIBLE_IF_KUNIT int drm_panic_helper_draw_screen_kmsg(struct drm_scanout_buffer
>   	drm_panic_helper_fill(sb, &r_screen, bg_color);
>   
>   	kmsg_dump_rewind(&iter);
> -	while (kmsg_dump_get_buffer(&iter, false, kmsg_buf, sizeof(kmsg_buf), &kmsg_len)) {
> +	while (yoffset >= 0 && kmsg_dump_get_buffer(&iter, false, kmsg_buf,
> +	       sizeof(kmsg_buf), &kmsg_len)) {
>   		char *start;
>   		char *end;
>   
> +		/* a record that does not fit comes back empty, every time */
> +		if (!kmsg_len)
> +			break;
> +
>   		/* ignore terminating NUL and newline */
>   		start = kmsg_buf + kmsg_len - 2;
>   		end = kmsg_buf + kmsg_len - 1;


      reply	other threads:[~2026-11-20 14:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:10 Devin Wittmayer
2026-11-20 14:34 ` Jocelyn Falempe [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=dc4518d6-c62c-428a-94a2-39c84cafc83a@redhat.com \
    --to=jfalempe@redhat.com \
    --cc=airlied@gmail.com \
    --cc=desobei@outlook.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucid_duck@justthetip.ca \
    --cc=luyuantao@kylinos.cn \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®