aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kernel-parameters.txt9
-rw-r--r--drivers/pci/pci.c4
-rw-r--r--drivers/pci/pci.h2
-rw-r--r--drivers/pci/setup-bus.c34
4 files changed, 38 insertions, 11 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 7fb7a4b161ff..7dc523e082a2 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2109,8 +2109,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2109 the default. 2109 the default.
2110 off: Turn ECRC off 2110 off: Turn ECRC off
2111 on: Turn ECRC on. 2111 on: Turn ECRC on.
2112 realloc reallocate PCI resources if allocations done by BIOS 2112 realloc= Enable/disable reallocating PCI bridge resources
2113 are erroneous. 2113 if allocations done by BIOS are too small to
2114 accommodate resources required by all child
2115 devices.
2116 off: Turn realloc off
2117 on: Turn realloc on
2118 realloc same as realloc=on
2114 2119
2115 pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power 2120 pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power
2116 Management. 2121 Management.
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 8f30736dbf3f..e9f9dc183cfc 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3772,8 +3772,10 @@ static int __init pci_setup(char *str)
3772 pci_no_msi(); 3772 pci_no_msi();
3773 } else if (!strcmp(str, "noaer")) { 3773 } else if (!strcmp(str, "noaer")) {
3774 pci_no_aer(); 3774 pci_no_aer();
3775 } else if (!strncmp(str, "realloc=", 8)) {
3776 pci_realloc_get_opt(str + 8);
3775 } else if (!strncmp(str, "realloc", 7)) { 3777 } else if (!strncmp(str, "realloc", 7)) {
3776 pci_realloc(); 3778 pci_realloc_get_opt("on");
3777 } else if (!strcmp(str, "nodomains")) { 3779 } else if (!strcmp(str, "nodomains")) {
3778 pci_no_domains(); 3780 pci_no_domains();
3779 } else if (!strncmp(str, "cbiosize=", 9)) { 3781 } else if (!strncmp(str, "cbiosize=", 9)) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 586ac9b097e4..1fc63b39f83f 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -149,7 +149,7 @@ static inline void pci_no_msi(void) { }
149static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } 149static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { }
150#endif 150#endif
151 151
152extern void pci_realloc(void); 152void pci_realloc_get_opt(char *);
153 153
154static inline int pci_no_d1d2(struct pci_dev *dev) 154static inline int pci_no_d1d2(struct pci_dev *dev)
155{ 155{
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 162edfb356b6..219722df68d6 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -48,13 +48,6 @@ static void free_list(struct list_head *head)
48 } 48 }
49} 49}
50 50
51int pci_realloc_enable = 0;
52#define pci_realloc_enabled() pci_realloc_enable
53void pci_realloc(void)
54{
55 pci_realloc_enable = 1;
56}
57
58/** 51/**
59 * add_to_list() - add a new resource tracker to the list 52 * add_to_list() - add a new resource tracker to the list
60 * @head: Head of the list 53 * @head: Head of the list
@@ -1273,6 +1266,33 @@ static int __init pci_get_max_depth(void)
1273 return depth; 1266 return depth;
1274} 1267}
1275 1268
1269/*
1270 * -1: undefined, will auto detect later
1271 * 0: disabled by user
1272 * 1: disabled by auto detect
1273 * 2: enabled by user
1274 * 3: enabled by auto detect
1275 */
1276enum enable_type {
1277 undefined = -1,
1278 user_disabled,
1279 auto_disabled,
1280 user_enabled,
1281 auto_enabled,
1282};
1283
1284static enum enable_type pci_realloc_enable __initdata = undefined;
1285void __init pci_realloc_get_opt(char *str)
1286{
1287 if (!strncmp(str, "off", 3))
1288 pci_realloc_enable = user_disabled;
1289 else if (!strncmp(str, "on", 2))
1290 pci_realloc_enable = user_enabled;
1291}
1292static bool __init pci_realloc_enabled(void)
1293{
1294 return pci_realloc_enable >= user_enabled;
1295}
1276 1296
1277/* 1297/*
1278 * first try will not touch pci bridge res 1298 * first try will not touch pci bridge res