lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f57f29a6-1db3-ab0b-a1f7-77074d1c10e8@suse.de>
Date:   Thu, 19 Jan 2023 09:00:44 +0100
From:   Thomas Zimmermann <tzimmermann@...e.de>
To:     Michal Suchánek <msuchanek@...e.de>,
        "Erhard F." <erhard_f@...lbox.org>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Frank Rowand <frowand.list@...il.com>,
        Javier Martinez Canillas <javierm@...hat.com>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" 
        <devicetree@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] of: Make of framebuffer devices unique

Hi Michal,

thanks for fixing this issue. But the review time was way too short. 
Please see my comments below.

Am 18.01.23 um 22:46 schrieb Michal Suchánek:
> On Wed, Jan 18, 2023 at 09:13:05PM +0100, Erhard F. wrote:
>> On Tue, 17 Jan 2023 17:58:04 +0100
>> Michal Suchanek <msuchanek@...e.de> wrote:
>>
>>> Since Linux 5.19 this error is observed:
>>>
>>> sysfs: cannot create duplicate filename '/devices/platform/of-display'
>>>
>>> This is because multiple devices with the same name 'of-display' are
>>> created on the same bus.
>>>
>>> Update the code to create numbered device names for the non-boot
>>> disaplay.
>>>
>>> cc: linuxppc-dev@...ts.ozlabs.org
>>> References: https://bugzilla.kernel.org/show_bug.cgi?id=216095
>>> Fixes: 52b1b46c39ae ("of: Create platform devices for OF framebuffers")
>>> Reported-by: Erhard F. <erhard_f@...lbox.org>
>>> Suggested-by: Thomas Zimmermann <tzimmermann@...e.de>
>>> Signed-off-by: Michal Suchanek <msuchanek@...e.de>
>>> ---
>>>   drivers/of/platform.c | 8 +++++++-
>>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
>>> index 81c8c227ab6b..f2a5d679a324 100644
>>> --- a/drivers/of/platform.c
>>> +++ b/drivers/of/platform.c
>>> @@ -525,6 +525,7 @@ static int __init of_platform_default_populate_init(void)
>>>   	if (IS_ENABLED(CONFIG_PPC)) {
>>>   		struct device_node *boot_display = NULL;
>>>   		struct platform_device *dev;
>>> +		int display_number = 1;
>>>   		int ret;
>>>   
>>>   		/* Check if we have a MacOS display without a node spec */
>>> @@ -561,10 +562,15 @@ static int __init of_platform_default_populate_init(void)
>>>   			boot_display = node;
>>>   			break;
>>>   		}
>>> +
>>>   		for_each_node_by_type(node, "display") {
>>> +			char *buf[14];
>>>   			if (!of_get_property(node, "linux,opened", NULL) || node == boot_display)
>>>   				continue;
>>> -			of_platform_device_create(node, "of-display", NULL);
>>> +			ret = snprintf(buf, "of-display-%d", display_number++);

Platform devices use a single dot (.) as separator before the index. 
Counting starts at zero. See /sys/bus/platform/ for examples. Can we 
please stick with that scheme? Generated names would then be 
of-display.0, of-display.1, etc.

Best regards
Thomas



>>> +			if (ret >= sizeof(buf))
>>> +				continue;
>>> +			of_platform_device_create(node, buf, NULL);
>>>   		}
>>>   
>>>   	} else {
>>> -- 
>>> 2.35.3
>>>
>>
>> Thank you for the patch Michal!
>>
>> It applies on 6.2-rc4 but I get this build error with my config:
> 
> Indeed, it's doubly bad.
> 
> Where is the kernel test robot when you need it?
> 
> It should not be that easy to miss this file but clearly it can happen.
> 
> I will send a fixup.
> 
> Sorry about the mess.
> 
> Thanks
> 
> Michal

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ