]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: Make sure bus number resources stay within their parents bounds
authorAndreas Noever <andreas.noever@gmail.com>
Thu, 23 Jan 2014 20:59:25 +0000 (21:59 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 11 Feb 2014 00:12:45 +0000 (17:12 -0700)
commitc80a1bebb5499e673418be03b721a4571d30a1b4
treee8a5b0c822e36c98e89989337fc86b89888a5ebc
parentf7d35ec1d067ee31626d08a3aa36d39da0c84cbc
PCI: Make sure bus number resources stay within their parents bounds

Right now we use 0xff for busn_res.end when probing and later reduce it to
the value that is actually used. This does not work if a parent bridge has
already a lower subordinate value. For example during hotplug of a new
bridge below an already-configured bridge the following message is printed
from pci_bus_insert_busn_res():

  pci_bus 0000:06: busn_res: can not insert [bus 06-ff] under [bus 05-9b] (conflicts with (null) [bus 05-9b])

This patch clamps the bus range to that of the parent and also ensures that
we do not exceed the parents range when assigning the final subordinate
value.

We also check that busses configured by the firmware fit into their parents
bounds.

[bhelgaas: reword dev_warn() and fix printk format warning]
Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c