linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: "Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"Len Brown" <lenb@kernel.org>,
	"K. Y. Srinivasan" <kys@microsoft.com>,
	"Haiyang Zhang" <haiyangz@microsoft.com>,
	"Stephen Hemminger" <sthemmin@microsoft.com>,
	"Wei Liu" <wei.liu@kernel.org>,
	"Dexuan Cui" <decui@microsoft.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-acpi@vger.kernel.org, linux-hyperv@vger.kernel.org,
	"Sunil Muthuswamy" <sunilmut@microsoft.com>,
	"Marc Zyngier" <maz@kernel.org>, "Arnd Bergmann" <arnd@arndb.de>
Subject: [RFC 4/5] arm64: PCI: Retrieve ACPI device information directly from host bridges
Date: Wed, 11 Aug 2021 23:36:18 +0800	[thread overview]
Message-ID: <20210811153619.88922-5-boqun.feng@gmail.com> (raw)
In-Reply-To: <20210811153619.88922-1-boqun.feng@gmail.com>

Now since we store the corresponding ACPI device pointer in the
->private of pci_host_bridge, use it instead of the sysdata to retrieve
the ACPI device information. Doing this decouples the dependency on the
pci_config_window structure in Hyper-V virtual PCI, because passing a
NULL pointer as the ACPI device is the soly reason of the dependency.

The decoupling avoids adding pci_config_window in hv_pcibus_dev and also
makes the code cleaner.

Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
---
 arch/arm64/kernel/pci.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
index 2276689b5411..783971749eb7 100644
--- a/arch/arm64/kernel/pci.c
+++ b/arch/arm64/kernel/pci.c
@@ -82,25 +82,13 @@ int acpi_pci_bus_find_domain_nr(struct pci_bus *bus)
 
 int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
 {
-	struct pci_config_window *cfg;
 	struct acpi_device *adev;
 	struct device *bus_dev;
 
 	if (acpi_disabled)
 		return 0;
 
-	cfg = bridge->bus->sysdata;
-
-	/*
-	 * On Hyper-V there is no corresponding ACPI device for a root bridge,
-	 * therefore ->parent is set as NULL by the driver. And set 'adev' as
-	 * NULL in this case because there is no proper ACPI device.
-	 */
-	if (!cfg->parent)
-		adev = NULL;
-	else
-		adev = to_acpi_device(cfg->parent);
-
+	adev = acpi_pci_root_device(bridge);
 	bus_dev = &bridge->bus->dev;
 
 	ACPI_COMPANION_SET(&bridge->dev, adev);
-- 
2.32.0


  parent reply	other threads:[~2021-08-11 15:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 15:36 [RFC 0/5] PCI: Use the private field of pci_host_bridge for ACPI device Boqun Feng
2021-08-11 15:36 ` [RFC 1/5] PCI: Introduce pci_create_root_bus_priv() Boqun Feng
2021-08-11 15:36 ` [RFC 2/5] PCI/ACPI: Store ACPI device information in the host bridge structure Boqun Feng
2021-08-11 15:36 ` [RFC 3/5] PCI: hv: Set NULL as the ACPI device for the PCI host bridge Boqun Feng
2021-08-11 15:36 ` Boqun Feng [this message]
2021-08-11 15:36 ` [RFC 5/5] PCI: hv: Remove the dependency of pci_config_window Boqun Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210811153619.88922-5-boqun.feng@gmail.com \
    --to=boqun.feng@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kw@linux.com \
    --cc=kys@microsoft.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=maz@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robh@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=wei.liu@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).