diff options
author | Eric W. Biederman <ebiederm@aristanetworks.com> | 2009-09-09 17:09:24 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-09-09 17:10:24 -0400 |
commit | 28760489a3f1e136c5ae8581c0fa8f63511f2f4c (patch) | |
tree | a3c890e9c8d9e98385691d56f5c007d280514fe5 /drivers/pci/pci.c | |
parent | 0ba379ec0fb182a87b8891c5754abbcd9c035b4f (diff) |
PCI: pcie: Ensure hotplug ports have a minimum number of resources
In general a BIOS may goof or we may hotplug in a hotplug controller.
In either case the kernel needs to reserve resources for plugging
in more devices in the future instead of creating a minimal resource
assignment.
We already do this for cardbus bridges I am just adding a variant
for pcie bridges.
v2: Make testing for pcie hotplug bridges based on a flag.
So far we only set the flag for pcie but a header_quirk
could easily be added for the non-standard pci hotplug
bridges.
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index bd993351db45..8c663d628d03 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -41,6 +41,12 @@ int pci_domains_supported = 1; | |||
41 | unsigned long pci_cardbus_io_size = DEFAULT_CARDBUS_IO_SIZE; | 41 | unsigned long pci_cardbus_io_size = DEFAULT_CARDBUS_IO_SIZE; |
42 | unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE; | 42 | unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE; |
43 | 43 | ||
44 | #define DEFAULT_HOTPLUG_IO_SIZE (256) | ||
45 | #define DEFAULT_HOTPLUG_MEM_SIZE (2*1024*1024) | ||
46 | /* pci=hpmemsize=nnM,hpiosize=nn can override this */ | ||
47 | unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE; | ||
48 | unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE; | ||
49 | |||
44 | /** | 50 | /** |
45 | * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children | 51 | * pci_bus_max_busnr - returns maximum PCI bus number of given bus' children |
46 | * @bus: pointer to PCI bus structure to search | 52 | * @bus: pointer to PCI bus structure to search |
@@ -2732,6 +2738,10 @@ static int __init pci_setup(char *str) | |||
2732 | strlen(str + 19)); | 2738 | strlen(str + 19)); |
2733 | } else if (!strncmp(str, "ecrc=", 5)) { | 2739 | } else if (!strncmp(str, "ecrc=", 5)) { |
2734 | pcie_ecrc_get_policy(str + 5); | 2740 | pcie_ecrc_get_policy(str + 5); |
2741 | } else if (!strncmp(str, "hpiosize=", 9)) { | ||
2742 | pci_hotplug_io_size = memparse(str + 9, &str); | ||
2743 | } else if (!strncmp(str, "hpmemsize=", 10)) { | ||
2744 | pci_hotplug_mem_size = memparse(str + 10, &str); | ||
2735 | } else { | 2745 | } else { |
2736 | printk(KERN_ERR "PCI: Unknown option `%s'\n", | 2746 | printk(KERN_ERR "PCI: Unknown option `%s'\n", |
2737 | str); | 2747 | str); |