From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter <daniel@ffwll.ch>
Cc: devicetree@vger.kernel.org, linux-fbdev@vger.kernel.org,
sam@ravnborg.org, frowand.list@gmail.com, deller@gmx.de,
dri-devel@lists.freedesktop.org, robh+dt@kernel.org,
paulus@samba.org, linuxppc-dev@lists.ozlabs.org,
linux@roeck-us.net
Subject: Re: [PATCH 2/2] fbdev: Remove hot-unplug workaround for framebuffers without device
Date: Tue, 19 Apr 2022 09:22:24 +0200 [thread overview]
Message-ID: <fb7b8ca6-a252-c021-fe74-4e7ffbb3eb7e@redhat.com> (raw)
In-Reply-To: <9d4599d9-e094-e7dd-5b91-282c2679aae4@suse.de>
Hello Thomas,
On 4/13/22 20:09, Thomas Zimmermann wrote:
[snip]
>>>> index bc6ed750e915..bdd00d381bbc 100644
>>>> --- a/drivers/video/fbdev/core/fbmem.c
>>>> +++ b/drivers/video/fbdev/core/fbmem.c
>>>> @@ -1579,14 +1579,7 @@ static void do_remove_conflicting_framebuffers(struct apertures_struct *a,
>>>> * If it's not a platform device, at least print a warning. A
>>>> * fix would add code to remove the device from the system.
>>>> */
>>>> - if (!device) {
>>>> - /* TODO: Represent each OF framebuffer as its own
>>>> - * device in the device hierarchy. For now, offb
>>>> - * doesn't have such a device, so unregister the
>>>> - * framebuffer as before without warning.
>>>> - */
>>>> - do_unregister_framebuffer(registered_fb[i]);
>>>
>>> Maybe we could still keep this for a couple of releases but with a big
>>> warning that's not supported in case there are out-of-tree drivers out
>>> there that still do this ?
>>>
>>> Or at least a warning if the do_unregister_framebuffer() call is removed.
>>
>> Yeah dying while holding console_lock isn't fun, and not having a WARN_ON
>> + bail-out code pretty much forces bug reporters to do a bisect here to
>> give us something more than "machine dies at boot with no messages".
>>
>> I'd just outright keep the WARN_ON here for 1-2 years even to really make
>> sure we got all the bug reports, since often these older machines only
>> update onto LTS releases.
>
> If that's what the consent is, I'll go with it.
>
> I'm just not sure if we talk about the same problem. offb didn't have a
> platform device, so we recently added this workaround with 'if
> (!device)'. All the other fbdev drivers have a platform device; and
> anything else that could fail is out-of-tree. We don't really care about
> those AFAIK.
>
Yes, agreed on the offb change but I'm not really sure if we don't care
about out-of-tree modules. I mean, you are right in theory but I still
feel that we are changing a core behavior without giving people time to
sort out if needed.
Since before commit 27599aacbaef ("fbdev: Hot-unplug firmware fb devices
on forced removal") registered FBs didn't need to have a device, but now
that will lead to a NULL pointer dereference in dev_is_platform(device).
And that change only landed in v5.18-rc1, so it is fairly recent.
I know that we follow https://www.kernel.org/doc/Documentation/process/stable-api-nonsense.rst
but still my opinion is that having a warning for a couple of releases
if registered_fb[i]->device is NULL, instead of just crashing would be
a better way to handle this.
> With offb converted, we could practically remove all of the checks here
> and call platform_device_unregister() unconditionally.
>
Yes for mainline, but as mentioned I thought mostly about out-of-tree. If
folks agree that we shouldn't care about these, I'm Ok with that as well.
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
prev parent reply other threads:[~2022-04-19 7:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 9:24 [PATCH 0/2] of: Register platform device for each framebuffer Thomas Zimmermann
2022-04-13 9:24 ` [PATCH 1/2] of: Create platform devices for OF framebuffers Thomas Zimmermann
2022-04-13 10:45 ` Javier Martinez Canillas
2022-04-13 10:49 ` Thomas Zimmermann
2022-04-13 12:51 ` Rob Herring
2022-04-13 17:58 ` Thomas Zimmermann
2022-04-13 18:02 ` Javier Martinez Canillas
2022-04-13 18:46 ` Rob Herring
2022-04-13 18:53 ` Rob Herring
2022-04-18 18:09 ` Thomas Zimmermann
2022-04-13 9:24 ` [PATCH 2/2] fbdev: Remove hot-unplug workaround for framebuffers without device Thomas Zimmermann
2022-04-13 10:50 ` Javier Martinez Canillas
2022-04-13 16:05 ` Daniel Vetter
2022-04-13 18:09 ` Thomas Zimmermann
2022-04-19 7:22 ` Javier Martinez Canillas [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=fb7b8ca6-a252-c021-fe74-4e7ffbb3eb7e@redhat.com \
--to=javierm@redhat.com \
--cc=daniel@ffwll.ch \
--cc=deller@gmx.de \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=frowand.list@gmail.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--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;
as well as URLs for NNTP newsgroup(s).