Re: [EXTERNAL] [RFC v4 5/7] PCI: hv: Use pci_host_bridge::domain_nr for PCI domain

From: Boqun Feng
Date: Thu Jul 15 2021 - 00:01:01 EST


On Wed, Jul 14, 2021 at 05:04:38PM +0000, Sunil Muthuswamy wrote:
> > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
> > index 8d42da5dd1d4..5741b1dd3c14 100644
> > --- a/drivers/pci/controller/pci-hyperv.c
> > +++ b/drivers/pci/controller/pci-hyperv.c
> > @@ -2299,7 +2299,7 @@ static void hv_eject_device_work(struct work_struct *work)
> > * because hbus->bridge->bus may not exist yet.
> > */
> > wslot = wslot_to_devfn(hpdev->desc.win_slot.slot);
> > - pdev = pci_get_domain_bus_and_slot(hbus->sysdata.domain, 0, wslot);
> > + pdev = pci_get_domain_bus_and_slot(hbus->bridge->domain_nr, 0, wslot);
> > if (pdev) {
> > pci_lock_rescan_remove();
> > pci_stop_and_remove_bus_device(pdev);
> > @@ -3071,6 +3071,7 @@ static int hv_pci_probe(struct hv_device *hdev,
> > "PCI dom# 0x%hx has collision, using 0x%hx",
> > dom_req, dom);
> >
> > + hbus->bridge->domain_nr = dom;
> > hbus->sysdata.domain = dom;
> With your other patches everything is moving over to based off of bridge->domain_nr.
> Do we still need to update sysdata.domain?

Yes, we still need it, because x86 is not a CONFIG_PCI_DOMAINS_GENERIC=y
architecture, and this patchset only makes CONFIG_PCI_DOMAINS_GENERIC=y
archs work with bridge->domain_nr. x86 still use the arch-specific
pci_domain_nr(), so we need to set the field in sysdata.

Regards,
Boqun

>