Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp438101rdb; Thu, 30 Nov 2023 08:32:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEEm7j5u/iB2dLf4B1AXiqKcJJbenOFMvwRCy6Ho/WkMeu/gIZecYmAEbhDNOu82GCX+9x X-Received: by 2002:a05:6a21:6d95:b0:18c:9705:47cd with SMTP id wl21-20020a056a216d9500b0018c970547cdmr17181110pzb.52.1701361936719; Thu, 30 Nov 2023 08:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701361936; cv=none; d=google.com; s=arc-20160816; b=du6bY0bkiNbHgHbLwOnSos6CalYDb73v0CSTCT49e3Y9G4tpeaBJL2nSPL7xd9B6Xs f1lnIcQUD4y/bfnrIKCBBbzQwdbigQ6KDUG/8PMyK7tiXDwihOFtWQdbOQId53WzWcyv 8QkqnypJiEx11BIS9jm/GynpoQRHrbO9V7Ct2zlGZA7n1Cd1obJxaEFfbDW5MgpIWphz uKXRS3B8LuC5n/WjJai/U+IrQc7xzy5vC/Wh+Nc+18O8iWsDMl42EA/T4y4gfPIXc/rR vbRn3cc5CisPW42ty7rHLHf5RkWGKtO95s8XPYIK6qs76fZzJXczzkiZLEHQ2k35jlBw aTIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=gV797xi3EHSsgCrohMrZSKeBc2F3mil55AHD5+9kXrY=; fh=qT/WXVxFxfsWbuNMqGE0tg4rWDP0Pvs1Y8q9HAVMKC8=; b=RGj0aOJ382hBjZK/E8gJJjLb3b8C5MrcjFu9NWOWbZwiW52Qn89hUM8asHNBD8a1rs HOa0ad0c4SQOVESYoIQ+ABHAbTpW8oya6wqZFChYpzu3ohuvKxJvlkrD0TYDWOTJ+C2t lqeXcJ4k6vS4GuXxaJfBny1t6tcg1iOKHKwfIAyfhMKEIShUIWqA//Vd19PnzQOuT2x2 7adtES1aivwGb2y8AijCdu/35eb+Wb05o2hRKlGuc/fsp4Mz+PcdpUdPIfTGv3J4i7dk 1XzD/PnE2SJVG4dyjE+FxhglFzMcJlKhgVgHLdubGFjkluktHYaFV6Sb4JG6ngoKVftG 1ynw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mMdBAWV8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d4-20020a056a0010c400b006cbb6f87036si1579589pfu.97.2023.11.30.08.32.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:32:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=mMdBAWV8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E481E809BB96; Thu, 30 Nov 2023 08:32:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231856AbjK3Qbx (ORCPT + 99 others); Thu, 30 Nov 2023 11:31:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjK3Qbw (ORCPT ); Thu, 30 Nov 2023 11:31:52 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A0D41B4; Thu, 30 Nov 2023 08:31:57 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 323F92000A; Thu, 30 Nov 2023 16:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701361916; h=from:from:reply-to:subject:subject: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=gV797xi3EHSsgCrohMrZSKeBc2F3mil55AHD5+9kXrY=; b=mMdBAWV8m01Tg4INI11/mzYDWX0kf3pzOfTi039efVlOvsIrsMqYFZxwwhQ7PDK2lMvoiT +i9DwVp+gnxMeXKfX1ZC+skcTbImVXeVnHyXLrnYCRh1xPFfoIl3gpq5Cv2mCKImVYe/+F A/rpY/AcJqomxU8jIB3nCzs6qRQFtGLfA9h9rQUuChX4dneMvYrA8wvxNco/oJrAX19ZXG /PgZLIklOt1LPzj29JI35SNkMDGyzuYiDf7AQr7kIRGSu0TcSWYoHjl/GapZ1MgDmCwFHC rLbg/ULOb0AETBWXfxscSZwtkkKdbExE/OcMuzBndJilW1zqTdVz8BAn9Q6Iuw== Date: Thu, 30 Nov 2023 17:31:53 +0100 From: Herve Codina To: Greg Kroah-Hartman 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: <20231130173153.1ce8a354@bootlin.com> In-Reply-To: <2023113008-prenatal-pushchair-956f@gregkh> References: <20231130152418.680966-1-herve.codina@bootlin.com> <20231130152418.680966-3-herve.codina@bootlin.com> <2023113008-prenatal-pushchair-956f@gregkh> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 30 Nov 2023 08:32:14 -0800 (PST) Hi Greg, On Thu, 30 Nov 2023 16:18:58 +0000 Greg Kroah-Hartman wrote: > 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, My bad, I will add cc: stable in the other patch needed. Sorry about that. Hervé -- Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com