lkml.org 
[lkml]   [2012]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -v11 30/30] PCI: Don't shrink too much for hotplug bridge
Date
Otherwise may have problem later if we plug pcie cards with bridges.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/pci/probe.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 01ba48e..38e0448 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -782,6 +782,7 @@ static int __devinit pci_bridge_check_busn_broken(struct pci_bus *bus,

static unsigned int __devinit __pci_scan_child_bus(struct pci_bus *bus,
int pass);
+#define HOTPLUG_BRIDGE_RESERVE_BUSNR 8
/*
* If it's a bridge, configure it and scan the bus behind it.
* For CardBus bridges, we don't scan behind as the devices will
@@ -993,6 +994,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
/*
* Set the subordinate bus number to its real value.
*/
+ if (dev->is_hotplug_bridge && child->subordinate > max &&
+ (max - child->secondary) < HOTPLUG_BRIDGE_RESERVE_BUSNR)
+ max = min_t(int, child->secondary +
+ HOTPLUG_BRIDGE_RESERVE_BUSNR,
+ child->subordinate);
shrink_size = child->subordinate - max;
child->subordinate = max;
pci_write_config_byte(dev, PCI_SUBORDINATE_BUS, max);
--
1.7.7


\
 
 \ /
  Last update: 2012-03-19 06:49    [from the cache]
©2003-2011 Jasper Spaans