Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp86269lqp; Tue, 11 Jun 2024 15:57:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUljoCDrOnmZv8p054lYXkFmNEHZX4FnACyS9FORY1MuHlsq5p3xpHLMsMr4P3TxLlNC9GLQpQrN7yDib7q4HEOL20s/2ZrHvegSZHysQ== X-Google-Smtp-Source: AGHT+IEuQnn32FDbx56UBc2U/rRVvZ9GoWgwbLG5Jo/+Mak44M8zKCOzcQf+QQadLe/7kjv4OFlx X-Received: by 2002:adf:f60b:0:b0:35f:2139:9a49 with SMTP id ffacd0b85a97d-35fe88c4475mr62658f8f.30.1718146624102; Tue, 11 Jun 2024 15:57:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718146624; cv=pass; d=google.com; s=arc-20160816; b=IEYn94nl4xOiBzoCHHCxepaotSFawbhwaV2f23Gbzqp+dtb+7w8fWphSXb+RHnPRdg 4TuMKxRFNx9oUQ5P+/TW20acle/SUNPVRp3f9aejq3WDMvcHuNBggyrRO4sTwtrUdgPt SjHI4MrWSCpzXDOuarO1Q6SSFb1hIEDbRkd43pC7i1EMCXdogHcg2s1WZPGzxdTE4Ho6 O58LTf/XQl8ytRo+kIanYHAz7iCxVAVf4PfUco25MugPJ2ym2ru4SW1/Gt+sKFXuOYyt zoju+EOLPEeEO36bmg1+ptBwE6/JKpv8WMJZcnetCXYcdXqP3JwTQMiITQExcBOBAt3x bvRw== 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:message-id:subject:cc:to:from :date:dkim-signature; bh=+0HvxGNPcKdmPw6ULIPR7se3Rz0WHKWAjOyRDct1v6k=; fh=yr6H0T3KHgahQEioEQNcWtbiz+auLXCWSFFYubaICQE=; b=fubXkLlWuqxu1GAs66DgLOrqcgmIqjB5IQwqHozQWeY3Rp+cGCPTZilqXBFTSMj99/ KhURwd63/axigm/3Hw35wnHcp36zBx7QKk+bOFFwqKZqAoyZlDZIDBeFacWYrB/NDTat bGPxMRTK8NlcosVeArUX0CBHXW19GMOD3LyDG8PqwLelJmSwIuFfLnkOwkFxIy4Ki9oV 08HErN9k4Crc54BIzakSdt1gCk1Xxw7BKwbw8QJsqF7KpkXIURYzQ/0I+jbMoFKsd+Bp xBqZ97aSPOlfamOIk8dkzykDStsdDYdYdiytWtjafn67WnsYOvBO35UuG4u7kYKfiLTQ DolQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BA2Cs6I1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ef60f2d24si453017866b.690.2024.06.11.15.57.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 15:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-8820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BA2Cs6I1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-8820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-wireless+bounces-8820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8CC6E1F23357 for ; Tue, 11 Jun 2024 22:57:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EA58155C80; Tue, 11 Jun 2024 22:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BA2Cs6I1" X-Original-To: linux-wireless@vger.kernel.org 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 DF3787D3FA; Tue, 11 Jun 2024 22:56:30 +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=1718146591; cv=none; b=mubPdkyNYjN/OhuXWoetP6FENoqR/2R3BRSY/q+mg6RZkCeyzWPjsMdSK+AoevgDAOktHgSLOA/GnZ0A41yNyCUouswFXXhQx1P5MeV5pJSAo+J5TrslA1QSYUwaZ6tH7wZbHFpvIE6iNMxsnlpGMWwQ6s0e/Rv4UDGnzqJQx98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718146591; c=relaxed/simple; bh=qnNWTWk0UrgyhvUjk0j87kljyjnbkKARlOWolh0T5tw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=m6rZM+itVvoYSFXR2HBXLTgWKY+Ua+t1a/TzFBJNlrLLCY+EMAIQEji0sosPF52hWrsHm3NCMdGd/EuT5AsTjFurtSB5QmXOrrpZelF+AiV5LmDzUuRs6DeJm/0IIcbmH5EsFDqmPXctxWSYeUoMh5EpsfZSUxmwH/tjTRpnbSc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BA2Cs6I1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36142C2BD10; Tue, 11 Jun 2024 22:56:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718146590; bh=qnNWTWk0UrgyhvUjk0j87kljyjnbkKARlOWolh0T5tw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=BA2Cs6I1BYbjUh7E1G9n4X7oIKQ+SDHio2B3ehBM9+FfN7UHRGYljUoeXk41tmjBk ker4TmT/a0IKRWDRVXOeVZYzqwh7Ka/WsKnyALVe4mTtvhMF2FdPI8j7ZrBsR1M3LO Nx+NkX7AcMkh7smKLa6WylB9wPJg059VPN84hJmPVZRHjxubr6oMsd6Rp4xPSruIDM MGAJdOSGevzLQR/qcHvMxEjoSlTbS9pFhBP6hjAgFnuXPw2WZtX7d3MWBySJG3l08c MOWQrcBACAq9HTplPxxxswYW+awMscqOryBFh0i2sGUoSLae74mqPiFXFJt2OnypTU edN/9Z3wjCixA== Date: Tue, 11 Jun 2024 17:56:28 -0500 From: Bjorn Helgaas To: Bartosz Golaszewski Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marcel Holtmann , Luiz Augusto von Dentz , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Balakrishna Godavarthi , Rocky Liao , Kalle Valo , Jeff Johnson , Bjorn Andersson , Konrad Dybcio , Bjorn Helgaas , Srini Kandagatla , Elliot Berman , Caleb Connolly , Neil Armstrong , Dmitry Baryshkov , Alex Elder , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, Jeff Johnson , ath12k@lists.infradead.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org, Bartosz Golaszewski , kernel@quicinc.com, Amit Pundir Subject: Re: [PATCH v8 14/17] PCI/pwrctl: create platform devices for child OF nodes of the port node Message-ID: <20240611225628.GA1005877@bhelgaas> Precedence: bulk X-Mailing-List: linux-wireless@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: <20240528-pwrseq-v8-14-d354d52b763c@linaro.org> On Tue, May 28, 2024 at 09:03:22PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > In preparation for introducing PCI device power control - a set of > library functions that will allow powering-up of PCI devices before > they're detected on the PCI bus - we need to populate the devices > defined on the device-tree. > > We are reusing the platform bus as it provides us with all the > infrastructure we need to match the pwrctl drivers against the > compatibles from OF nodes. > > These platform devices will be probed by the driver core and bound to > the PCI pwrctl drivers we'll introduce later. > > Tested-by: Amit Pundir > Signed-off-by: Bartosz Golaszewski With s/create/Create/ in subject, Acked-by: Bjorn Helgaas > --- > drivers/pci/bus.c | 9 +++++++++ > drivers/pci/remove.c | 3 ++- > 2 files changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c > index 826b5016a101..3e3517567721 100644 > --- a/drivers/pci/bus.c > +++ b/drivers/pci/bus.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -354,6 +355,14 @@ void pci_bus_add_device(struct pci_dev *dev) > pci_warn(dev, "device attach failed (%d)\n", retval); > > pci_dev_assign_added(dev, true); > + > + if (pci_is_bridge(dev)) { > + retval = of_platform_populate(dev->dev.of_node, NULL, NULL, > + &dev->dev); > + if (retval) > + pci_err(dev, "failed to populate child OF nodes (%d)\n", > + retval); > + } > } > EXPORT_SYMBOL_GPL(pci_bus_add_device); > > diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c > index d749ea8250d6..910387e5bdbf 100644 > --- a/drivers/pci/remove.c > +++ b/drivers/pci/remove.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0 > #include > #include > +#include > #include "pci.h" > > static void pci_free_resources(struct pci_dev *dev) > @@ -18,7 +19,7 @@ static void pci_stop_dev(struct pci_dev *dev) > pci_pme_active(dev, false); > > if (pci_dev_is_added(dev)) { > - > + of_platform_depopulate(&dev->dev); > device_release_driver(&dev->dev); > pci_proc_detach_device(dev); > pci_remove_sysfs_dev_files(dev); > > -- > 2.43.0 >