Hi Marek Am 13.06.24 um 07:59 schrieb Marek Olšák:
Hi Thomas, Commit 9eac534db0013aff9b9124985dab114600df9081 as per the title breaks (crashes?) lightdm (login screen) such that all I get is the terminal. It's also reproducible with tag v6.9 where the commit is present.
I still cannot reproduce the problem reliably. But I've found a ref-counting bug on the parent device that was introduced by that commit. This needs to be fixed anyway. A patch is attached if you want to test.
Best regards Thomas
Reverting the commit fixes lightdm. A workaround is to bypass lightdm by triggering auto-login. This is a bug report. (For AMD folks: It's also reproducible with amd-staging-drm-next.) Marek
-- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
From 5ca700a36fc06e1ec5b3c2c9a383c2d0011c0d83 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann <tzimmermann@xxxxxxx> Date: Tue, 18 Jun 2024 17:37:11 +0200 Subject: [PATCH] firmware: sysfb: Fix reference count of syfb parent device Retrieving the system framebuffer's parent device in sysfb_init() increments the parent device's reference count. Hence release the reference before leaving the init function. Adding the sysfb platform device acquires and additional reference for the parent. This keeps the parent device around while the system framebuffer is in use. Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx> Fixes: 9eac534db001 ("firmware/sysfb: Set firmware-framebuffer parent device") Cc: Thomas Zimmermann <tzimmermann@xxxxxxx> Cc: Javier Martinez Canillas <javierm@xxxxxxxxxx> Cc: Helge Deller <deller@xxxxxx> Cc: Jani Nikula <jani.nikula@xxxxxxxxx> Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Cc: Arnd Bergmann <arnd@xxxxxxxx> Cc: Sui Jingfeng <suijingfeng@xxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> # v6.9+ --- drivers/firmware/sysfb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c index 880ffcb500887..a316bd92dfed2 100644 --- a/drivers/firmware/sysfb.c +++ b/drivers/firmware/sysfb.c @@ -137,7 +137,7 @@ static __init int sysfb_init(void) if (compatible) { pd = sysfb_create_simplefb(si, &mode, parent); if (!IS_ERR(pd)) - goto unlock_mutex; + goto put_device; } /* if the FB is incompatible, create a legacy framebuffer device */ @@ -155,7 +155,7 @@ static __init int sysfb_init(void) pd = platform_device_alloc(name, 0); if (!pd) { ret = -ENOMEM; - goto unlock_mutex; + goto put_device; } pd->dev.parent = parent; @@ -170,9 +170,12 @@ static __init int sysfb_init(void) if (ret) goto err; - goto unlock_mutex; + + goto put_device; err: platform_device_put(pd); +put_device: + put_device(parent); unlock_mutex: mutex_unlock(&disable_lock); return ret; -- 2.45.2