PCI: Do not use bus number zero from EA capability
authorSubbaraya Sundeep <sbhatta@marvell.com>
Mon, 4 Nov 2019 06:57:44 +0000 (12:27 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 14 Nov 2019 21:02:10 +0000 (15:02 -0600)
commit73884a7082f466ce6686bb8dd7e6571dd42313b4
tree9a81a92c5af1caf203f749c6dc160c7038bb851f
parentc13704f5685deb7d6eb21e293233e0901ed77377
PCI: Do not use bus number zero from EA capability

As per PCIe r5.0, sec 7.8.5.2, fixed bus numbers of a bridge must be zero
when no function that uses EA is located behind it.  Hence, if EA supplies
bus numbers of zero, assign bus numbers normally.  A secondary bus can
never have a bus number of zero, so setting a bridge's Secondary Bus Number
to zero makes downstream devices unreachable.

[bhelgaas: retain bool return value so "zero is invalid" logic is local]
Fixes: 2dbce5901179 ("PCI: Assign bus numbers present in EA capability for bridges")
Link: https://lore.kernel.org/r/1572850664-9861-1-git-send-email-sundeep.lkml@gmail.com
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org # v5.2+
drivers/pci/probe.c