aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7c1b362f599a..766f5779db92 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6262,8 +6262,7 @@ static int __init pci_setup(char *str)
6262 } else if (!strncmp(str, "pcie_scan_all", 13)) { 6262 } else if (!strncmp(str, "pcie_scan_all", 13)) {
6263 pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS); 6263 pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS);
6264 } else if (!strncmp(str, "disable_acs_redir=", 18)) { 6264 } else if (!strncmp(str, "disable_acs_redir=", 18)) {
6265 disable_acs_redir_param = 6265 disable_acs_redir_param = str + 18;
6266 kstrdup(str + 18, GFP_KERNEL);
6267 } else { 6266 } else {
6268 printk(KERN_ERR "PCI: Unknown option `%s'\n", 6267 printk(KERN_ERR "PCI: Unknown option `%s'\n",
6269 str); 6268 str);
@@ -6274,3 +6273,19 @@ static int __init pci_setup(char *str)
6274 return 0; 6273 return 0;
6275} 6274}
6276early_param("pci", pci_setup); 6275early_param("pci", pci_setup);
6276
6277/*
6278 * 'disable_acs_redir_param' is initialized in pci_setup(), above, to point
6279 * to data in the __initdata section which will be freed after the init
6280 * sequence is complete. We can't allocate memory in pci_setup() because some
6281 * architectures do not have any memory allocation service available during
6282 * an early_param() call. So we allocate memory and copy the variable here
6283 * before the init section is freed.
6284 */
6285static int __init pci_realloc_setup_params(void)
6286{
6287 disable_acs_redir_param = kstrdup(disable_acs_redir_param, GFP_KERNEL);
6288
6289 return 0;
6290}
6291pure_initcall(pci_realloc_setup_params);