Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp430490rdb; Thu, 30 Nov 2023 08:21:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6gJkrYST2ZUoca7uP2mwcGZig4s9IlunDgn+ZjXvlOSAISV+rsvwV+e4lctyn5JZA/MXp X-Received: by 2002:a05:6a20:9193:b0:187:dd5f:93b9 with SMTP id v19-20020a056a20919300b00187dd5f93b9mr24540168pzd.14.1701361261120; Thu, 30 Nov 2023 08:21:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701361261; cv=none; d=google.com; s=arc-20160816; b=Ggm+F490NB40JGkd+89OcZbNla9ha1xHKsI/VbKyfFG1DZce447rZ8eeWT74NNAAN9 iumFCU0yLNSrA2X+Js/JAYhIAu4gen8HW7rR9tbtVKlupHB0lD8u7HmKlWVReRR+mTLJ 43hYhhMIuvBbv3xiGs0pVQqHo1SYJ8pjAjnyPlo9fF+tecVK4d2MIB2jY0Qn4Qof+gc6 DDz8PHxNWALuSqArPQ/0osFfIfIGQH1tjLY2HO++8pC6xQv5sPplVqg8dHG3go2RJQ2C wEXR0eGetPgUFgjYSyauxATrBWP38o4HdURZqr7Jd0x+//Uoc15JtN/h2aEUJy1apcOr XyXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hg7ZqHU5NPKDMVONq+eL0ZJb1taZ8tLSvKjezQMQFnQ=; fh=4/MNonWc7T5CncYggJwkXxMKKK2i9gQLyMvySzgNnro=; b=Bf5qkSrMff/trjUqdwWH9N4xZpkJpY57PwBc7O4DptOi6u8kK/FU/tMuroJkLXS62V 2oLRUkUIIiUmObz0Fs4LbIjbAtE7BvrqepbQ4PejeM0+SadrVQQV05tCT5s296ZWMAMM WenA1LXnOOJaHovVrGGGaeSjCRquFv4dhboSdq37iA0IMt8YkCcGXfS2uEsQOZEDnZr+ pvLGnRMKF987xAmwmFjb6sKkt4lLObUYugOnU6Rkqyh+ldGBT5UCNaPzZMb1Ci2HSRUq U2ySs2h8Zun2lU524Yfm7aMwOUj09FUghn0xL1XEsfYfdDNNgkYun4KS7G3Zk86K+C73 Qlvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfCmaJXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id k4-20020a6568c4000000b00563f72935e3si1537084pgt.608.2023.11.30.08.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:21:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PfCmaJXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id E3E408025806; Thu, 30 Nov 2023 08:20:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231997AbjK3QTs (ORCPT + 99 others); Thu, 30 Nov 2023 11:19:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345312AbjK3QTX (ORCPT ); Thu, 30 Nov 2023 11:19:23 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01F531BF8 for ; Thu, 30 Nov 2023 08:19:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FB9DC433CC; Thu, 30 Nov 2023 16:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1701361141; bh=ev/3cQ8WkO4ZH4x0KC/Ak2z7sd7hRQCPFQGQ6Q/urBQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PfCmaJXBScFzJTswaF+Ez0GyO6+FrNirwBnvtipOEyATe/Oj7aCtY4gb2IbLvIw3v UT2OisJ5UHOnYXLTF2YapcC795BuXiQBsvxfvlRuOmQxZquDtKxyYzfD+NVeAOOjsM Fp0hFHIoBvU0J4PDqQNXpCRvtJrSXeTPGFsEA4Nc= Date: Thu, 30 Nov 2023 16:18:58 +0000 From: Greg Kroah-Hartman To: Herve Codina Cc: "Rafael J. Wysocki" , Bjorn Helgaas , Lizhi Hou , Rob Herring , Max Zhen , Sonal Santan , Stefano Stabellini , Jonathan Cameron , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , stable@vger.kernel.org Subject: Re: [PATCH 2/2] PCI: of: Attach created of_node to existing device Message-ID: <2023113008-prenatal-pushchair-956f@gregkh> References: <20231130152418.680966-1-herve.codina@bootlin.com> <20231130152418.680966-3-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231130152418.680966-3-herve.codina@bootlin.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 08:20:20 -0800 (PST) On Thu, Nov 30, 2023 at 04:24:04PM +0100, Herve Codina wrote: > The commit 407d1a51921e ("PCI: Create device tree node for bridge") > creates of_node for PCI devices. > During the insertion handling of these new DT nodes done by of_platform, > new devices (struct device) are created. > For each PCI devices a struct device is already present (created and > handled by the PCI core). > Having a second struct device to represent the exact same PCI device is > not correct. > > On the of_node creation, tell the of_platform that there is no need to > create a device for this node (OF_POPULATED flag), link this newly > created of_node to the already present device and tell fwnode that the > device attached to this of_node is ready (fwnode_dev_initialized()). > > With this fix, the of_node are available in the sysfs device tree: > /sys/devices/platform/soc/d0070000.pcie/ > + of_node -> .../devicetree/base/soc/pcie@d0070000 > + pci0000:00 > + 0000:00:00.0 > + of_node -> .../devicetree/base/soc/pcie@d0070000/pci@0,0 > + 0000:01:00.0 > + of_node -> .../devicetree/base/soc/pcie@d0070000/pci@0,0/dev@0,0 > > On the of_node removal, revert the operations. > > Fixes: 407d1a51921e ("PCI: Create device tree node for bridge") > Cc: stable@vger.kernel.org How can this be cc: stable when the api it relies on is not? confused, greg k-h