Re: linux-next: manual merge of the drm tree with the drm-misc-fixes tree
From: Devin Wittmayer
Date: Mon Oct 19 2026 - 15:10:41 EST
Hi Mark,
On Mon, Oct 19, 2026 at 05:10:46PM +0100, Mark Brown wrote:
> This obviously isn't the right merge, it drops the fixes.
Two of those fixes are mine, so I had a go at it. The code that draws
the panic screen was moved into drm_panic_helper.c in drm-next, so two of
the three need to move with it. The third one, for the panic screen
setting, made it through your merge fine. Today's drm-tip has the same
gap.
This puts the two back, on top of your merge:
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;
I tried it in QEMU on drm-next, ten runs of each:
after the panic your merge with this
sysrq c reboots reboots
one 600 character line hangs reboots
600 characters, then 400 lines hangs reboots
one record over 2048 bytes hangs reboots
oops, 1008 character modules line hangs reboots
The drm_panic KUnit tests pass with and without it.
Thanks for catching it,
Devin