Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp399688lqg; Thu, 11 Apr 2024 06:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVbCVaRLVhFBtOgEAdjoAmhv3v56JvbqSMc490bhYd0hgikc3BZ1rQYFAirYADp35NLoVbcAix+OXGnGw+7mLHNX73TNEC0nVQ0ZBCA6A== X-Google-Smtp-Source: AGHT+IH3BqPOJO+JxIM61SjHkdO40RJ7D/r58ePC5iaLnAJo+fln+DTZEFuOcHuUbAltbW5c3m9W X-Received: by 2002:aa7:8885:0:b0:6e7:3223:4556 with SMTP id z5-20020aa78885000000b006e732234556mr5973571pfe.32.1712842489799; Thu, 11 Apr 2024 06:34:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712842489; cv=pass; d=google.com; s=arc-20160816; b=JAOPOGr0qghIzJ+a2McsOSXCM7MHW4fKMFfUpbRT0EIK5nh21v5suQYirjRZ3E4h1q HqloCiBL9KwJdQDk8/3r7EynetOaK/4hRNg3H52Nher8n9sB0SoAZVkfFhfHrXaJA9NB tQ9gzj2KWZ9TKhufGEk8PWFCZjfyhbHlKT9S2ENEQ+0I4h0dC4v6fOmClXXmA5s4LOO/ eve6nEgGdhe3oqfoYzWrfH35fyMkWu1UZ/kB3kWF2ucJYABKFgnCGBYT006G2swRc1MI 4Ghtd7p/N+HQFesyfqGOwkS19HNDYWZk+ERnetWoRPcyGl3OdsHiOlgdP8HhzRxemMj6 Uagw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fogn1Y67hg4vevH07JnhEgBeSaxVyRNLFcV3zjculGg=; fh=aZO+2DB9sN7PyGBaYNTYJUYhQ/YH/WV3NylVH0Q7JOo=; b=womPobNjCzpfyF0laL5BD8nRs2w0amN/kAEPPnUdro6m2juddspSgtcrB9LTvDcXjE 0K0vgluRZIE4FW84yXBs2WIHaHqD4yDu86fXzHZRoN14vjOxRm21lJ/u6a55eESqUpfV KiMuVUMs5MjfsdaUrYFLzNgNWbqipiyXOk42RXpsXO86I16TfkaUa7AxbSGV05FWUS3A lt6NrD4tki/S0RSyT5al80ykFMmxRv3kBHy9B0YbcM3185Z15kxIJ7vJd4NpyNf4oMl6 OhsaHb1nfG4htbG+layv8Acr7HTiSY6rWOL7gLo2COq3MAoE82Xcg31ZjCsKLtHlpej9 AH1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fcEaIz9k; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-140497-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e13-20020aa78c4d000000b006e8f569a4bcsi1408015pfd.63.2024.04.11.06.34.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 06:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140497-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fcEaIz9k; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-140497-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9012CB2114A for ; Thu, 11 Apr 2024 13:24:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C34B614D29E; Thu, 11 Apr 2024 13:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="fcEaIz9k" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9F15335BC; Thu, 11 Apr 2024 13:23:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712841839; cv=none; b=ra3WszG6uoBKbapQLt3iIcP3rptdXbbYWUR+4njYz5hOsyulxrTyvAkBPQD191b3dJmUh8sEcRDuzKN3mQdc0fDSwU8+u2syzRBLyqKHw2+HdOfut2dWzR7Hx6CSyFpfOY/JXxcSHwvhpylE3IqCNhPBwmV9IBTQaqFB2SYHXF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712841839; c=relaxed/simple; bh=ETgA5noj6Ysp52fHUsZ5Xahb/AFo+afbTPHONR6SsNw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tyiXmoe2QIg2UKz2k7L2uoCU6Sob+R40C+z8BVJUV2n75OBm//k4NmwIcnvMnYlRisxka0CS5elsABJuPfYThlA2dTaqW/KPJQXgWULOBvoqujv+x7nNvfCKS/YKOCTG61bDyWo/Ze66HjE645i4PfftXcCgU2xfFFmrZ6N5Rws= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=fcEaIz9k; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0663C4AF50; Thu, 11 Apr 2024 13:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712841838; bh=ETgA5noj6Ysp52fHUsZ5Xahb/AFo+afbTPHONR6SsNw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fcEaIz9k3Q4JpS8tEx7maD/lLU7Byeg3qH88bJrZZw/ILHbrSyNdM7ycqQP5KsEcL jrpF+rlPaTDPwUDOjZhOj36XxyuV/vqh2JeflTu+H0P1DHQrndWZTYedLVJHfMurle hCBMWSqVKtPKQSlxm1lyi9wNYaDVytKVB4NStey8= Date: Thu, 11 Apr 2024 15:23:55 +0200 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 , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , 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 v3 2/2] PCI: of: Attach created of_node to existing device Message-ID: <2024041142-applause-spearman-bd38@gregkh> References: <20240325153919.199337-1-herve.codina@bootlin.com> <20240325153919.199337-3-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325153919.199337-3-herve.codina@bootlin.com> On Mon, Mar 25, 2024 at 04:39:15PM +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, > - tell fwnode that the device attached to this of_node is ready using > 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 > Signed-off-by: Herve Codina I need an ack from the maintainer here before I can take this. thanks, greg k-h