diff options
author | Andi Kleen <ak@suse.de> | 2006-03-23 17:35:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:35:12 -0500 |
commit | 92c05fc1a32e5ccef5e0e8201f32dcdab041524c (patch) | |
tree | 71c0202dffee676d3b2e0b75ea4472aaa2ffe8df /arch/i386/pci/direct.c | |
parent | e4e73041ecc4a3559c42ed9489f58531c2a8646b (diff) |
[PATCH] PCI: Give PCI config access initialization a defined ordering
I moved it to a separate function which is safer.
This avoids problems with the linker reordering them and the
less useful PCI config space access methods taking priority
over the better ones.
Fixes some problems with broken MMCONFIG
Cc: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/i386/pci/direct.c')
-rw-r--r-- | arch/i386/pci/direct.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/i386/pci/direct.c b/arch/i386/pci/direct.c index e3ac502bf2fb..99012b93bd12 100644 --- a/arch/i386/pci/direct.c +++ b/arch/i386/pci/direct.c | |||
@@ -245,7 +245,7 @@ static int __init pci_check_type2(void) | |||
245 | return works; | 245 | return works; |
246 | } | 246 | } |
247 | 247 | ||
248 | static int __init pci_direct_init(void) | 248 | void __init pci_direct_init(void) |
249 | { | 249 | { |
250 | struct resource *region, *region2; | 250 | struct resource *region, *region2; |
251 | 251 | ||
@@ -258,16 +258,16 @@ static int __init pci_direct_init(void) | |||
258 | if (pci_check_type1()) { | 258 | if (pci_check_type1()) { |
259 | printk(KERN_INFO "PCI: Using configuration type 1\n"); | 259 | printk(KERN_INFO "PCI: Using configuration type 1\n"); |
260 | raw_pci_ops = &pci_direct_conf1; | 260 | raw_pci_ops = &pci_direct_conf1; |
261 | return 0; | 261 | return; |
262 | } | 262 | } |
263 | release_resource(region); | 263 | release_resource(region); |
264 | 264 | ||
265 | type2: | 265 | type2: |
266 | if ((pci_probe & PCI_PROBE_CONF2) == 0) | 266 | if ((pci_probe & PCI_PROBE_CONF2) == 0) |
267 | goto out; | 267 | return; |
268 | region = request_region(0xCF8, 4, "PCI conf2"); | 268 | region = request_region(0xCF8, 4, "PCI conf2"); |
269 | if (!region) | 269 | if (!region) |
270 | goto out; | 270 | return; |
271 | region2 = request_region(0xC000, 0x1000, "PCI conf2"); | 271 | region2 = request_region(0xC000, 0x1000, "PCI conf2"); |
272 | if (!region2) | 272 | if (!region2) |
273 | goto fail2; | 273 | goto fail2; |
@@ -275,15 +275,10 @@ static int __init pci_direct_init(void) | |||
275 | if (pci_check_type2()) { | 275 | if (pci_check_type2()) { |
276 | printk(KERN_INFO "PCI: Using configuration type 2\n"); | 276 | printk(KERN_INFO "PCI: Using configuration type 2\n"); |
277 | raw_pci_ops = &pci_direct_conf2; | 277 | raw_pci_ops = &pci_direct_conf2; |
278 | return 0; | 278 | return; |
279 | } | 279 | } |
280 | 280 | ||
281 | release_resource(region2); | 281 | release_resource(region2); |
282 | fail2: | 282 | fail2: |
283 | release_resource(region); | 283 | release_resource(region); |
284 | |||
285 | out: | ||
286 | return 0; | ||
287 | } | 284 | } |
288 | |||
289 | arch_initcall(pci_direct_init); | ||