OSDN Git Service

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)
commit1820ffdccb9b4398c5f0f70360edc68e039c3c72
treee8a5b0c822e36c98e89989337fc86b89888a5ebc
parentced04d15519a15d38b46162b94a1f26b4022116e
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