[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tukp7ziz.wl-maz@kernel.org>
Date: Tue, 20 Jul 2021 16:53:08 +0100
From: Marc Zyngier <maz@...nel.org>
To: Boqun Feng <boqun.feng@...il.com>
Cc: Bjorn Helgaas <bhelgaas@...gle.com>, Arnd Bergmann <arnd@...db.de>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, Dexuan Cui <decui@...rosoft.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-pci@...r.kernel.org,
Sunil Muthuswamy <sunilmut@...rosoft.com>,
Mike Rapoport <rppt@...nel.org>
Subject: Re: [RFC v5 8/8] PCI: hv: Turn on the host bridge probing on ARM64
On Tue, 20 Jul 2021 15:59:41 +0100,
Boqun Feng <boqun.feng@...il.com> wrote:
>
> On Tue, Jul 20, 2021 at 03:38:26PM +0100, Marc Zyngier wrote:
> > On Tue, 20 Jul 2021 14:44:29 +0100,
> > Boqun Feng <boqun.feng@...il.com> wrote:
> > >
> > > Now we have everything we need, just provide a proper sysdata type for
> > > the bus to use on ARM64 and everything else works.
> > >
> > > Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> > > ---
> > > drivers/pci/controller/pci-hyperv.c | 7 +++++++
> > > 1 file changed, 7 insertions(+)
> > >
> > > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > > index e6276aaa4659..62dbe98d1fe1 100644
> > > --- a/drivers/pci/controller/pci-hyperv.c
> > > +++ b/drivers/pci/controller/pci-hyperv.c
> > > @@ -40,6 +40,7 @@
> > > #include <linux/kernel.h>
> > > #include <linux/module.h>
> > > #include <linux/pci.h>
> > > +#include <linux/pci-ecam.h>
> > > #include <linux/delay.h>
> > > #include <linux/semaphore.h>
> > > #include <linux/irqdomain.h>
> > > @@ -448,7 +449,11 @@ enum hv_pcibus_state {
> > > };
> > >
> > > struct hv_pcibus_device {
> > > +#ifdef CONFIG_X86
> > > struct pci_sysdata sysdata;
> > > +#elif defined(CONFIG_ARM64)
> > > + struct pci_config_window sysdata;
> > > +#endif
> >
> > Am I the only one who find this rather odd? Nothing ever populates
> > this data structure on arm64, and its only purpose seems to serve as
> > an anchor to retrieve the hbus via container_of().
> >
>
> This field will also be used as the ->sysdata of pci_bus and
> pci_host_bridge, and some of the PCI core code touches. Although I made
> this field as all zeroed and make sure PCI core can handle (patch #4).
Huh, I see. I missed this particular nugget. This is so convoluted...
> > If that's indeed the case, I'd rather see an arch-specific to_hbus()
> > helper that uses another (preexisting) field as the anchor for arm64.
> >
>
> I did a quick look, but I didn't find another field works: the field
> needs to be placed inside hv_pcibus_device and the address can be
> retrieved via pci_bus. I'm open to any suggestion in case that I missed
> something.
No, the above pretty much kills my suggestion.
Thanks for the explanation,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists