From: Thomas Zimmermann <tzimmermann@suse.de>
To: "Marek Olšák" <maraeo@gmail.com>,
javierm@redhat.com, pjones@redhat.com, deller@gmx.de,
ardb@kernel.org, dri-devel <dri-devel@lists.freedesktop.org>,
linux-fbdev@vger.kernel.org, "Deucher,
Alexander" <Alexander.Deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>
Subject: Re: "firmware/sysfb: Set firmware-framebuffer parent device" breaks lightdm on Ubuntu 22.04 using amdgpu
Date: Fri, 21 Jun 2024 11:50:41 +0200 [thread overview]
Message-ID: <9e55c009-d82d-4f1b-a8b3-33deb77e4f3c@suse.de> (raw)
In-Reply-To: <CAAxE2A7qK1-b5g1RR-GJ+QTLEr_OxEr9vcZGEOkZY9yLOFLb5w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 948 bytes --]
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)
[-- Attachment #2: 0001-firmware-sysfb-Fix-reference-count-of-syfb-parent-de.patch --]
[-- Type: text/x-patch, Size: 2021 bytes --]
From 5ca700a36fc06e1ec5b3c2c9a383c2d0011c0d83 Mon Sep 17 00:00:00 2001
From: Thomas Zimmermann <tzimmermann@suse.de>
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@suse.de>
Fixes: 9eac534db001 ("firmware/sysfb: Set firmware-framebuffer parent device")
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Sui Jingfeng <suijingfeng@loongson.cn>
Cc: <stable@vger.kernel.org> # 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
prev parent reply other threads:[~2024-06-21 9:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 5:59 "firmware/sysfb: Set firmware-framebuffer parent device" breaks lightdm on Ubuntu 22.04 using amdgpu Marek Olšák
2024-06-13 6:00 ` Marek Olšák
2024-06-13 7:23 ` Thomas Zimmermann
2024-06-13 14:20 ` Marek Olšák
2024-06-13 14:59 ` Thomas Zimmermann
2024-06-19 13:50 ` Thomas Zimmermann
2024-06-19 18:40 ` Marek Olšák
2024-06-20 6:40 ` Thomas Zimmermann
2024-06-21 9:50 ` Thomas Zimmermann [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=9e55c009-d82d-4f1b-a8b3-33deb77e4f3c@suse.de \
--to=tzimmermann@suse.de \
--cc=Alexander.Deucher@amd.com \
--cc=ardb@kernel.org \
--cc=christian.koenig@amd.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=maraeo@gmail.com \
--cc=pjones@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox