From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, linux-kernel@vger.kernel.org
Cc: Sam Ravnborg <sam@ravnborg.org>,
Maxime Ripard <maxime@cerno.tech>,
Junxiao Chang <junxiao.chang@intel.com>,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v2] fbdev: Use helper to get fb_info in all file operations
Date: Wed, 4 May 2022 10:26:30 +0200 [thread overview]
Message-ID: <3f8f697f-7b85-cb8c-445a-8d7c40a062f8@redhat.com> (raw)
In-Reply-To: <d0555181-6e36-044c-b747-c08dbeb3a89e@suse.de>
Hello Thomas,
On 5/4/22 10:15, Thomas Zimmermann wrote:
> Hi
>
> Am 03.05.22 um 22:19 schrieb Javier Martinez Canillas:
>> A reference to the framebuffer device struct fb_info is stored in the file
>> private data, but this reference could no longer be valid and must not be
>> accessed directly. Instead, the file_fb_info() accessor function must be
>> used since it does sanity checking to make sure that the fb_info is valid.
>>
>> This can happen for example if the registered framebuffer device is for a
>> driver that just uses a framebuffer provided by the system firmware. In
>> that case, the fbdev core would unregister the framebuffer device when a
>> real video driver is probed and ask to remove conflicting framebuffers.
>>
>> Most fbdev file operations already use the helper to get the fb_info but
>> get_fb_unmapped_area() and fb_deferred_io_fsync() don't. Fix those two.
>>
>> Since fb_deferred_io_fsync() is not in fbmem.o, the helper has to be
>> exported. Rename it and add a fb_ prefix to denote that is public now.
>>
>> Reported-by: Junxiao Chang <junxiao.chang@intel.com>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
Thanks.
> Please see my comment below.
[snip]
>>
>> + if (!info)
>> + return -ENODEV;
>> +
>
> This is consistent with other functions, but it's probably not the
> correct errno code. It means that a device is not available for opening.
>
> But the situation here is rather as with close() on a
> disconnected-network file. The call to close() returns EIO in this case.
> Maybe we should consider changing this in a separate patch.
>
Indeed. Agree that -EIO makes more sense here.
> Best regards
> Thomas
>
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
next prev parent reply other threads:[~2022-05-04 8:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 20:19 [PATCH v2] fbdev: Use helper to get fb_info in all file operations Javier Martinez Canillas
2022-05-03 20:53 ` Sam Ravnborg
2022-05-04 8:15 ` Thomas Zimmermann
2022-05-04 8:26 ` Javier Martinez Canillas [this message]
2022-05-04 9:02 ` Daniel Vetter
2022-05-04 9:27 ` Thomas Zimmermann
2022-05-04 9:28 ` Javier Martinez Canillas
2022-05-04 10:55 ` Daniel Vetter
2022-05-04 11:08 ` Thomas Zimmermann
2022-05-04 11:35 ` Javier Martinez Canillas
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=3f8f697f-7b85-cb8c-445a-8d7c40a062f8@redhat.com \
--to=javierm@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=junxiao.chang@intel.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime@cerno.tech \
--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).