diff options
| -rw-r--r-- | drivers/pci/bus.c | 4 | ||||
| -rw-r--r-- | drivers/pci/quirks.c | 20 |
2 files changed, 5 insertions, 19 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index b511bd4e3f7c..4b0970b46e0b 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
| @@ -164,10 +164,8 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
| 164 | int pci_bus_add_device(struct pci_dev *dev) | 164 | int pci_bus_add_device(struct pci_dev *dev) |
| 165 | { | 165 | { |
| 166 | int retval; | 166 | int retval; |
| 167 | extern bool pci_fixup_final_inited; | ||
| 168 | 167 | ||
| 169 | if (pci_fixup_final_inited) | 168 | pci_fixup_device(pci_fixup_final, dev); |
| 170 | pci_fixup_device(pci_fixup_final, dev); | ||
| 171 | retval = device_add(&dev->dev); | 169 | retval = device_add(&dev->dev); |
| 172 | if (retval) | 170 | if (retval) |
| 173 | return retval; | 171 | return retval; |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 52f44b58945d..003f356a897c 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
| @@ -2956,6 +2956,7 @@ extern struct pci_fixup __end_pci_fixups_resume_early[]; | |||
| 2956 | extern struct pci_fixup __start_pci_fixups_suspend[]; | 2956 | extern struct pci_fixup __start_pci_fixups_suspend[]; |
| 2957 | extern struct pci_fixup __end_pci_fixups_suspend[]; | 2957 | extern struct pci_fixup __end_pci_fixups_suspend[]; |
| 2958 | 2958 | ||
| 2959 | static bool pci_apply_fixup_final_quirks; | ||
| 2959 | 2960 | ||
| 2960 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | 2961 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) |
| 2961 | { | 2962 | { |
| @@ -2973,6 +2974,8 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
| 2973 | break; | 2974 | break; |
| 2974 | 2975 | ||
| 2975 | case pci_fixup_final: | 2976 | case pci_fixup_final: |
| 2977 | if (!pci_apply_fixup_final_quirks) | ||
| 2978 | return; | ||
| 2976 | start = __start_pci_fixups_final; | 2979 | start = __start_pci_fixups_final; |
| 2977 | end = __end_pci_fixups_final; | 2980 | end = __end_pci_fixups_final; |
| 2978 | break; | 2981 | break; |
| @@ -3006,21 +3009,6 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
| 3006 | EXPORT_SYMBOL(pci_fixup_device); | 3009 | EXPORT_SYMBOL(pci_fixup_device); |
| 3007 | 3010 | ||
| 3008 | 3011 | ||
| 3009 | /* | ||
| 3010 | * The global variable 'pci_fixup_final_inited' is being used as a interim | ||
| 3011 | * solution for calling the final quirks only during hot-plug events (not | ||
| 3012 | * during boot processing). | ||
| 3013 | * | ||
| 3014 | * When the boot path's PCI device setup sequencing is addressed, we can | ||
| 3015 | * remove the instance, and usages of, 'pci_fixup_final_inited' along with | ||
| 3016 | * removing 'fs_initcall_sync(pci_apply_final_quirks);' and end up with a | ||
| 3017 | * single, uniform, solution that satisfies both the boot path and the | ||
| 3018 | * various hot-plug event paths. | ||
| 3019 | * | ||
| 3020 | * ToDo: Remove 'pci_fixup_final_inited' | ||
| 3021 | */ | ||
| 3022 | bool pci_fixup_final_inited; | ||
| 3023 | |||
| 3024 | static int __init pci_apply_final_quirks(void) | 3012 | static int __init pci_apply_final_quirks(void) |
| 3025 | { | 3013 | { |
| 3026 | struct pci_dev *dev = NULL; | 3014 | struct pci_dev *dev = NULL; |
| @@ -3031,6 +3019,7 @@ static int __init pci_apply_final_quirks(void) | |||
| 3031 | printk(KERN_DEBUG "PCI: CLS %u bytes\n", | 3019 | printk(KERN_DEBUG "PCI: CLS %u bytes\n", |
| 3032 | pci_cache_line_size << 2); | 3020 | pci_cache_line_size << 2); |
| 3033 | 3021 | ||
| 3022 | pci_apply_fixup_final_quirks = true; | ||
| 3034 | for_each_pci_dev(dev) { | 3023 | for_each_pci_dev(dev) { |
| 3035 | pci_fixup_device(pci_fixup_final, dev); | 3024 | pci_fixup_device(pci_fixup_final, dev); |
| 3036 | /* | 3025 | /* |
| @@ -3051,7 +3040,6 @@ static int __init pci_apply_final_quirks(void) | |||
| 3051 | pci_cache_line_size = pci_dfl_cache_line_size; | 3040 | pci_cache_line_size = pci_dfl_cache_line_size; |
| 3052 | } | 3041 | } |
| 3053 | } | 3042 | } |
| 3054 | pci_fixup_final_inited = 1; | ||
| 3055 | 3043 | ||
| 3056 | if (!pci_cache_line_size) { | 3044 | if (!pci_cache_line_size) { |
| 3057 | printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n", | 3045 | printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n", |
