diff options
author | Myron Stowe <myron.stowe@redhat.com> | 2012-07-13 16:29:00 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-07-16 11:14:49 -0400 |
commit | 95df8b8708a8b381bf276d83c56f7b4e7de04a71 (patch) | |
tree | 930878161272c1c9c5a7f52988cc68bc53878c60 /drivers/pci | |
parent | 735bff10c157fdbba2291e10ca3e28a59c7acc1c (diff) |
PCI: fix undefined reference to 'pci_fixup_final_inited'
My "PCI: Integrate 'pci_fixup_final' quirks into hot-plug paths" patch
introduced an undefined reference to 'pci_fixup_final_inited' when
CONFIG_PCI_QUIRKS is not enabled (on x86_64):
drivers/built-in.o: In function `pci_bus_add_device':
(.text+0x4f62): undefined reference to `pci_fixup_final_inited'
This patch removes the external reference ending up with a result closer
to what we ultimately want when the boot path issues described in the
original patch are resolved.
References:
https://lkml.org/lkml/2012/7/9/542 Original, offending, patch
https://lkml.org/lkml/2012/7/12/338 Randy's catch
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Diffstat (limited to 'drivers/pci')
-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 d8e9a0edf93c..2472df8a903f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -2979,6 +2979,7 @@ extern struct pci_fixup __end_pci_fixups_resume_early[]; | |||
2979 | extern struct pci_fixup __start_pci_fixups_suspend[]; | 2979 | extern struct pci_fixup __start_pci_fixups_suspend[]; |
2980 | extern struct pci_fixup __end_pci_fixups_suspend[]; | 2980 | extern struct pci_fixup __end_pci_fixups_suspend[]; |
2981 | 2981 | ||
2982 | static bool pci_apply_fixup_final_quirks; | ||
2982 | 2983 | ||
2983 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | 2984 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) |
2984 | { | 2985 | { |
@@ -2996,6 +2997,8 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
2996 | break; | 2997 | break; |
2997 | 2998 | ||
2998 | case pci_fixup_final: | 2999 | case pci_fixup_final: |
3000 | if (!pci_apply_fixup_final_quirks) | ||
3001 | return; | ||
2999 | start = __start_pci_fixups_final; | 3002 | start = __start_pci_fixups_final; |
3000 | end = __end_pci_fixups_final; | 3003 | end = __end_pci_fixups_final; |
3001 | break; | 3004 | break; |
@@ -3029,21 +3032,6 @@ void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev) | |||
3029 | EXPORT_SYMBOL(pci_fixup_device); | 3032 | EXPORT_SYMBOL(pci_fixup_device); |
3030 | 3033 | ||
3031 | 3034 | ||
3032 | /* | ||
3033 | * The global variable 'pci_fixup_final_inited' is being used as a interim | ||
3034 | * solution for calling the final quirks only during hot-plug events (not | ||
3035 | * during boot processing). | ||
3036 | * | ||
3037 | * When the boot path's PCI device setup sequencing is addressed, we can | ||
3038 | * remove the instance, and usages of, 'pci_fixup_final_inited' along with | ||
3039 | * removing 'fs_initcall_sync(pci_apply_final_quirks);' and end up with a | ||
3040 | * single, uniform, solution that satisfies both the boot path and the | ||
3041 | * various hot-plug event paths. | ||
3042 | * | ||
3043 | * ToDo: Remove 'pci_fixup_final_inited' | ||
3044 | */ | ||
3045 | bool pci_fixup_final_inited; | ||
3046 | |||
3047 | static int __init pci_apply_final_quirks(void) | 3035 | static int __init pci_apply_final_quirks(void) |
3048 | { | 3036 | { |
3049 | struct pci_dev *dev = NULL; | 3037 | struct pci_dev *dev = NULL; |
@@ -3054,6 +3042,7 @@ static int __init pci_apply_final_quirks(void) | |||
3054 | printk(KERN_DEBUG "PCI: CLS %u bytes\n", | 3042 | printk(KERN_DEBUG "PCI: CLS %u bytes\n", |
3055 | pci_cache_line_size << 2); | 3043 | pci_cache_line_size << 2); |
3056 | 3044 | ||
3045 | pci_apply_fixup_final_quirks = true; | ||
3057 | for_each_pci_dev(dev) { | 3046 | for_each_pci_dev(dev) { |
3058 | pci_fixup_device(pci_fixup_final, dev); | 3047 | pci_fixup_device(pci_fixup_final, dev); |
3059 | /* | 3048 | /* |
@@ -3074,7 +3063,6 @@ static int __init pci_apply_final_quirks(void) | |||
3074 | pci_cache_line_size = pci_dfl_cache_line_size; | 3063 | pci_cache_line_size = pci_dfl_cache_line_size; |
3075 | } | 3064 | } |
3076 | } | 3065 | } |
3077 | pci_fixup_final_inited = 1; | ||
3078 | 3066 | ||
3079 | if (!pci_cache_line_size) { | 3067 | if (!pci_cache_line_size) { |
3080 | printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n", | 3068 | printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n", |