diff options
| -rw-r--r-- | Documentation/kernel-parameters.txt | 2 | ||||
| -rw-r--r-- | drivers/pci/pci.c | 2 | ||||
| -rw-r--r-- | drivers/pci/pci.h | 2 | ||||
| -rw-r--r-- | drivers/pci/setup-bus.c | 15 |
4 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index fd248a318211..aa47be71df4c 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -2015,6 +2015,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
| 2015 | the default. | 2015 | the default. |
| 2016 | off: Turn ECRC off | 2016 | off: Turn ECRC off |
| 2017 | on: Turn ECRC on. | 2017 | on: Turn ECRC on. |
| 2018 | realloc reallocate PCI resources if allocations done by BIOS | ||
| 2019 | are erroneous. | ||
| 2018 | 2020 | ||
| 2019 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power | 2021 | pcie_aspm= [PCIE] Forcibly enable or disable PCIe Active State Power |
| 2020 | Management. | 2022 | Management. |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 2c5b9b991279..692671b11667 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -3483,6 +3483,8 @@ static int __init pci_setup(char *str) | |||
| 3483 | pci_no_msi(); | 3483 | pci_no_msi(); |
| 3484 | } else if (!strcmp(str, "noaer")) { | 3484 | } else if (!strcmp(str, "noaer")) { |
| 3485 | pci_no_aer(); | 3485 | pci_no_aer(); |
| 3486 | } else if (!strncmp(str, "realloc", 7)) { | ||
| 3487 | pci_realloc(); | ||
| 3486 | } else if (!strcmp(str, "nodomains")) { | 3488 | } else if (!strcmp(str, "nodomains")) { |
| 3487 | pci_no_domains(); | 3489 | pci_no_domains(); |
| 3488 | } else if (!strncmp(str, "cbiosize=", 9)) { | 3490 | } else if (!strncmp(str, "cbiosize=", 9)) { |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 731e20265ace..3a39bf1f1e2c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -146,6 +146,8 @@ static inline void pci_no_msi(void) { } | |||
| 146 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 146 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
| 149 | extern void pci_realloc(void); | ||
| 150 | |||
| 149 | static inline int pci_no_d1d2(struct pci_dev *dev) | 151 | static inline int pci_no_d1d2(struct pci_dev *dev) |
| 150 | { | 152 | { |
| 151 | unsigned int parent_dstates = 0; | 153 | unsigned int parent_dstates = 0; |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1e9e5a5b8c81..9995842e45b5 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
| @@ -47,6 +47,13 @@ struct resource_list_x { | |||
| 47 | (head)->next = NULL; \ | 47 | (head)->next = NULL; \ |
| 48 | } while (0) | 48 | } while (0) |
| 49 | 49 | ||
| 50 | int pci_realloc_enable = 0; | ||
| 51 | #define pci_realloc_enabled() pci_realloc_enable | ||
| 52 | void pci_realloc(void) | ||
| 53 | { | ||
| 54 | pci_realloc_enable = 1; | ||
| 55 | } | ||
| 56 | |||
| 50 | /** | 57 | /** |
| 51 | * add_to_list() - add a new resource tracker to the list | 58 | * add_to_list() - add a new resource tracker to the list |
| 52 | * @head: Head of the list | 59 | * @head: Head of the list |
| @@ -1025,6 +1032,7 @@ static int __init pci_get_max_depth(void) | |||
| 1025 | return depth; | 1032 | return depth; |
| 1026 | } | 1033 | } |
| 1027 | 1034 | ||
| 1035 | |||
| 1028 | /* | 1036 | /* |
| 1029 | * first try will not touch pci bridge res | 1037 | * first try will not touch pci bridge res |
| 1030 | * second and later try will clear small leaf bridge res | 1038 | * second and later try will clear small leaf bridge res |
| @@ -1068,6 +1076,13 @@ again: | |||
| 1068 | /* any device complain? */ | 1076 | /* any device complain? */ |
| 1069 | if (!head.next) | 1077 | if (!head.next) |
| 1070 | goto enable_and_dump; | 1078 | goto enable_and_dump; |
| 1079 | |||
| 1080 | /* don't realloc if asked to do so */ | ||
| 1081 | if (!pci_realloc_enabled()) { | ||
| 1082 | free_list(resource_list_x, &head); | ||
| 1083 | goto enable_and_dump; | ||
| 1084 | } | ||
| 1085 | |||
| 1071 | failed_type = 0; | 1086 | failed_type = 0; |
| 1072 | for (list = head.next; list;) { | 1087 | for (list = head.next; list;) { |
| 1073 | failed_type |= list->flags; | 1088 | failed_type |= list->flags; |
