Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp709529rwb; Thu, 19 Jan 2023 01:24:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXvZliFvbacPo9IEKFNjJS0Ljbc31KSsoEgwJpQighgHKuvbShBjkRW10O+SiJ/47vBOKvYa X-Received: by 2002:a17:906:9506:b0:86b:1ccc:d434 with SMTP id u6-20020a170906950600b0086b1cccd434mr9941296ejx.67.1674120274568; Thu, 19 Jan 2023 01:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674120274; cv=none; d=google.com; s=arc-20160816; b=fLv7LdpcwkQz/kISOnLoS2BAG15e2m/9TRdHBVWe6XPouIHX48c+TR5E39mlAxwDU3 5XGKkge7XIrzxgbP+x5UZT3ReSz5omsDPwwqKICzfcUJ/I08+XeC5pwx9IgIK8ykylgZ Pi775O5UKZ6kTPL9xPa2fhw3O4gcLP0Wm8CoQlDmLEYkEPvOYkdei3vhRrsJHGake7gQ KmFddRbV6PnW8IalK4JO4UnrevABdb55rSHBE8OB21TorGhvSpeRbcE9avSiTrqiXj3w bCTdS8Z0s0dHrWTMvTfifdfyqHdgvxOj/eRhP03ypJww318O7PBOpdEMWWEC8Zw/40rg SPKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=rJjkIKKbDNZd/ESWe6P7/ngAac/K7/Dffw9Klu11+kY=; b=rkqYmjVel8cVkp4PWnZdobQMbCbCccOLXXxivWjQnrv0IVsWwN/9P7SdyHT5JVZmxu 0TljXz+YaYPL1Q50euSAysFei1oxfDcMvYT6F2Zjqwy6uYumg66BLDwbiN7fGFBGzDWp 2DOYih00/oZ8Fq2Ora+pgKr2n7LG+9u5lkgEyoIboVY9zJMMgKUagbsv0ciOhhbIP8gc UmG3uKATxj5I/NXmVguekPlupPaUuGQ8r3sGPFF/vJHT5C06U4iuv9Ixb+2b25P5YBDz DYpq7mq7lM+L2M5jiCzJovf9oW39BBtwLyj+ZQZ+vtlBzwBYVJFbEmtATd0wEaoUn2Gs aOnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GvYJW40A; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xj1-20020a170906db0100b007c4fadff8dasi42784912ejb.933.2023.01.19.01.24.21; Thu, 19 Jan 2023 01:24:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=GvYJW40A; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229789AbjASJBv (ORCPT + 44 others); Thu, 19 Jan 2023 04:01:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229446AbjASJBr (ORCPT ); Thu, 19 Jan 2023 04:01:47 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EA616796A; Thu, 19 Jan 2023 01:01:46 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0A2A15CB56; Thu, 19 Jan 2023 09:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674118905; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJjkIKKbDNZd/ESWe6P7/ngAac/K7/Dffw9Klu11+kY=; b=GvYJW40AKUaPIxT7/fZb5VtwH9UINs+LZqFfT8Z4QNdHC9DwXJzGCH91XoAwsbbeOyP9gc W5tjc3kFYliFFNJjnclyejzvldAad+pWmtfjyzyzT8gXMdsFXA/52rHQBsx4AvA/LhGTIi voL2cbqTM9XTS7ihyw7XTeqOogVCjZ8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674118905; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rJjkIKKbDNZd/ESWe6P7/ngAac/K7/Dffw9Klu11+kY=; b=IslDj+AOHOitb1mQoIKIQmwchzFrCNs9O0AxMs7soKB4+QsWKUgOGkiXubclJDkMaWZ42f 7AX9WBQ5mmaBQFAA== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id CDF782C142; Thu, 19 Jan 2023 09:01:44 +0000 (UTC) Date: Thu, 19 Jan 2023 10:01:43 +0100 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: Thomas Zimmermann Cc: "Erhard F." , Rob Herring , Frank Rowand , Javier Martinez Canillas , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , open list , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] of: Make of framebuffer devices unique Message-ID: <20230119090143.GN16547@kitsune.suse.cz> References: <20230117165804.18036-1-msuchanek@suse.de> <20230118211305.42e50a4a@yea> <20230118214618.GM16547@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2023 at 09:00:44AM +0100, Thomas Zimmermann wrote: > 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 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@lists.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. > > > > Suggested-by: Thomas Zimmermann > > > > Signed-off-by: Michal Suchanek > > > > --- > > > > 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. Yes, there was surprisingly no bikeshedding. Do we also want to change the name of the device that did manage to instantiate before? This scheme changes the name only for those that did not in the past, hence "of-display" and "of-display-%d", starting from 1. Sure, replacing '-' with '.' is easy enough, and using the same format for both as well. Thanks Michal > > 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