[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <41e119bc-5a93-c91e-7451-aa48f829dc1a@suse.de>
Date: Tue, 13 Jun 2023 09:31:22 +0200
From: Thomas Zimmermann <tzimmermann@...e.de>
To: "Ruhl, Michael J" <michael.j.ruhl@...el.com>,
"daniel@...ll.ch" <daniel@...ll.ch>,
"javierm@...hat.com" <javierm@...hat.com>,
"sam@...nborg.org" <sam@...nborg.org>,
"deller@....de" <deller@....de>,
"geert+renesas@...der.be" <geert+renesas@...der.be>,
"lee@...nel.org" <lee@...nel.org>,
"daniel.thompson@...aro.org" <daniel.thompson@...aro.org>,
"jingoohan1@...il.com" <jingoohan1@...il.com>,
"dan.carpenter@...aro.org" <dan.carpenter@...aro.org>
Cc: "linux-fbdev@...r.kernel.org" <linux-fbdev@...r.kernel.org>,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
"linux-sh@...r.kernel.org" <linux-sh@...r.kernel.org>,
"linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>
Subject: Re: [PATCH v2 01/38] backlight/bd6107: Compare against struct
fb_info.device
Hi
Am 12.06.23 um 17:17 schrieb Ruhl, Michael J:
[...]
>
> Thomas,
>
> Looking at the fb.h file I see:
>
> struct device *device; /* This is the parent */
> struct device *dev; /* This is this fb device */
>
> Is this documentation "correct"? If so, how does that match what you are doing here?
The comments are correct. Let's go through what's happening here.
The field 'device' is the Linux device (platform_device, pci_dev, etc.)
and 'dev' is the fbdev character device that is /dev/fb*.
We set 'device' where we allocate the fb_info in framebuffer_alloc()
https://elixir.bootlin.com/linux/v6.3/source/drivers/video/fbdev/core/fbsysfs.c#L57
and we set 'dev' when we register the chrdev within register_framebuffer().
https://elixir.bootlin.com/linux/v6.3/source/drivers/video/fbdev/core/fbmem.c#L1555
(And the point of this patch series is to make the chrdev optional.)
The problem with bd6107 is that is misses the part where it registers
the platform device. The driver appears to be unused.
But gpio_backlight from patches 3 and 4 works. The architecture code
sets the 'fbdev' field from a platform-device structure at
https://elixir.bootlin.com/linux/v6.3/source/arch/sh/boards/mach-ecovec24/setup.c#L389
and later creates the platform device as part of
https://elixir.bootlin.com/linux/v6.3/source/arch/sh/boards/mach-ecovec24/setup.c#L1483
It will be used with the sh-mobile fbdev driver and become the 'device'
field there.
In the backlight code, the gpio_backlight driver copies the fbdev field at
https://elixir.bootlin.com/linux/v6.3/source/drivers/video/backlight/gpio_backlight.c#L62
to later use it incorrectly in .check_fb. Hence, the helper has to
compare the platform device to the 'device' field, not the 'dev' field;
which is being fixed by this patchset.
The two other drivers, bd6107 and lv5207lp, have the same bug.
Best regards
Thomas
>
> Thanks,
>
> M
>
>> }
>>
>> static const struct backlight_ops bd6107_backlight_ops = {
>> --
>> 2.41.0
>
--
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)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists