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 <[email protected]> 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 <[email protected]> Closes: https://lore.kernel.org/all/ph7pr19mb6658fdbdd012399c6e8d330faf...@ph7pr19mb6658.namprd19.prod.outlook.com/ Tested-by: desobei <[email protected]> Cc: luyuantao <[email protected]> Signed-off-by: Devin Wittmayer <[email protected]> --- 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;
