]> 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)
commita3a45431dbd9e7e5502868046d12dddc1a4ed43e
treee8a5b0c822e36c98e89989337fc86b89888a5ebc
parent57c665467fc1c37f13d8be5de2af4a09330a36fd
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