]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: hv: Make sure the bus domain is really unique
authorSridhar Pitchai <Sridhar.Pitchai@microsoft.com>
Tue, 1 May 2018 17:56:32 +0000 (17:56 +0000)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 2 May 2018 15:05:40 +0000 (16:05 +0100)
commit004069aa6e5ea0af5bc6735afad4a90652681194
treec44b850b38505e79a15d985d39402d31a8c7010e
parent064bcb773e451d01c97b9b60772d30bcc3d5c90c
PCI: hv: Make sure the bus domain is really unique

When Linux runs as a guest VM in Hyper-V and Hyper-V adds the virtual PCI
bus to the guest, Hyper-V always provides unique PCI domain.

commit c44b8a58b717 ("PCI: hv: Use device serial number as PCI domain")
overrode unique domain with the serial number of the first device added to
the virtual PCI bus.

The reason for that patch was to have a consistent and short name for the
device, but Hyper-V doesn't provide unique serial numbers. Using non-unique
serial numbers as domain IDs leads to duplicate device addresses, which
causes PCI bus registration to fail.

commit 02e633075a17 ("netvsc: transparent VF management") avoids the need
for commit c44b8a58b717 ("PCI: hv: Use device serial number as PCI
domain").  When scripts were used to configure VF devices, the name of
the VF needed to be consistent and short, but with commit 02e633075a17
("netvsc: transparent VF management") all the setup is done in the kernel,
and we do not need to maintain consistent name.

Revert commit c44b8a58b717 ("PCI: hv: Use device serial number as PCI
domain") so we can reliably support multiple devices being assigned to
a guest.

Tag the patch for stable kernels containing commit 02e633075a17
("netvsc: transparent VF management").

Fixes: c44b8a58b717 ("PCI: hv: Use device serial number as PCI domain")
Signed-off-by: Sridhar Pitchai <sridhar.pitchai@microsoft.com>
[lorenzo.pieralisi@arm.com: trimmed commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.14+
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pci-hyperv.c