From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (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 0FDE1A41; Tue, 9 Jan 2024 14:43:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id B616B100DA1A2; Tue, 9 Jan 2024 15:43:27 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 875212C3E10; Tue, 9 Jan 2024 15:43:27 +0100 (CET) Date: Tue, 9 Jan 2024 15:43:27 +0100 From: Lukas Wunner To: Bartosz Golaszewski Cc: Kalle Valo , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Catalin Marinas , Will Deacon , Bjorn Helgaas , Heiko Stuebner , Jernej Skrabec , Chris Morgan , Linus Walleij , Geert Uytterhoeven , Arnd Bergmann , Neil Armstrong , =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Marek Szyprowski , Peng Fan , Robert Richter , Dan Williams , Jonathan Cameron , Terry Bowman , Kuppuswamy Sathyanarayanan , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Huacai Chen , Alex Elder , Srini Kandagatla , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Bartosz Golaszewski Subject: Re: [RFC 3/9] PCI/portdrv: create platform devices for child OF nodes Message-ID: <20240109144327.GA10780@wunner.de> References: <20240104130123.37115-1-brgl@bgdev.pl> <20240104130123.37115-4-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: devicetree@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: <20240104130123.37115-4-brgl@bgdev.pl> User-Agent: Mutt/1.10.1 (2018-07-13) On Thu, Jan 04, 2024 at 02:01:17PM +0100, Bartosz Golaszewski wrote: > In order to introduce PCIe power-sequencing, we need to create platform > devices for child nodes of the port driver node. They will get matched > against the pwrseq drivers (if one exists) and then the actuak PCIe > device will reuse the node once it's detected on the bus. [...] > --- a/drivers/pci/pcie/portdrv.c > +++ b/drivers/pci/pcie/portdrv.c > @@ -715,7 +716,7 @@ static int pcie_portdrv_probe(struct pci_dev *dev, > pm_runtime_allow(&dev->dev); > } > > - return 0; > + return devm_of_platform_populate(&dev->dev); > } I think this belongs in of_pci_make_dev_node(), portdrv seems totally the wrong place. Note that you're currently calling this for RCECs (Root Complex Event Collectors) as well, which is likely not what you want. devm functions can't be used in the PCI core, so symmetrically call of_platform_unpopulate() from of_pci_remove_node(). Thanks, Lukas