diff options
author | Daniel Burcaw <dburcaw@terrasoftsolutions.com> | 2005-09-09 16:04:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:58:02 -0400 |
commit | 5251bffc9b4ca699993c79166adf02faf1bbc043 (patch) | |
tree | 0d3a0c8f3efe9a71d68e7f9de0b79195aa790909 /drivers | |
parent | c5eb5c1ea919f3f717236c5d0892f9c37f19de37 (diff) |
[PATCH] radeonfb: Only request resources we need
This patch changes radeon to request only resources 0 and 2 instead of all
3. This works around problems with some setups where BAR 1 (IO BAR) has
not been assigned by the firmware since it's not used on the machine and
the kernel fails to assign something to it due to the card being between a
P2P bridge that was configured without an IO range at all.
This typically fixes radeonfb on some Apple Xserve G5 machines
Signed-off-by: Daniel Burcaw <dburcaw@terrasoftsolutions.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/aty/radeon_base.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index e7e8b52014c3..8a7c04c35a75 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c | |||
@@ -2312,19 +2312,27 @@ static int radeonfb_pci_register (struct pci_dev *pdev, | |||
2312 | rinfo->mmio_base_phys = pci_resource_start (pdev, 2); | 2312 | rinfo->mmio_base_phys = pci_resource_start (pdev, 2); |
2313 | 2313 | ||
2314 | /* request the mem regions */ | 2314 | /* request the mem regions */ |
2315 | ret = pci_request_regions(pdev, "radeonfb"); | 2315 | ret = pci_request_region(pdev, 0, "radeonfb framebuffer"); |
2316 | if (ret < 0) { | 2316 | if (ret < 0) { |
2317 | printk( KERN_ERR "radeonfb (%s): cannot reserve PCI regions." | 2317 | printk( KERN_ERR "radeonfb (%s): cannot request region 0.\n", |
2318 | " Someone already got them?\n", pci_name(rinfo->pdev)); | 2318 | pci_name(rinfo->pdev)); |
2319 | goto err_release_fb; | 2319 | goto err_release_fb; |
2320 | } | 2320 | } |
2321 | 2321 | ||
2322 | ret = pci_request_region(pdev, 2, "radeonfb mmio"); | ||
2323 | if (ret < 0) { | ||
2324 | printk( KERN_ERR "radeonfb (%s): cannot request region 2.\n", | ||
2325 | pci_name(rinfo->pdev)); | ||
2326 | goto err_release_pci0; | ||
2327 | } | ||
2328 | |||
2322 | /* map the regions */ | 2329 | /* map the regions */ |
2323 | rinfo->mmio_base = ioremap(rinfo->mmio_base_phys, RADEON_REGSIZE); | 2330 | rinfo->mmio_base = ioremap(rinfo->mmio_base_phys, RADEON_REGSIZE); |
2324 | if (!rinfo->mmio_base) { | 2331 | if (!rinfo->mmio_base) { |
2325 | printk(KERN_ERR "radeonfb (%s): cannot map MMIO\n", pci_name(rinfo->pdev)); | 2332 | printk(KERN_ERR "radeonfb (%s): cannot map MMIO\n", |
2333 | pci_name(rinfo->pdev)); | ||
2326 | ret = -EIO; | 2334 | ret = -EIO; |
2327 | goto err_release_pci; | 2335 | goto err_release_pci2; |
2328 | } | 2336 | } |
2329 | 2337 | ||
2330 | rinfo->fb_local_base = INREG(MC_FB_LOCATION) << 16; | 2338 | rinfo->fb_local_base = INREG(MC_FB_LOCATION) << 16; |
@@ -2499,10 +2507,12 @@ err_unmap_rom: | |||
2499 | if (rinfo->bios_seg) | 2507 | if (rinfo->bios_seg) |
2500 | radeon_unmap_ROM(rinfo, pdev); | 2508 | radeon_unmap_ROM(rinfo, pdev); |
2501 | iounmap(rinfo->mmio_base); | 2509 | iounmap(rinfo->mmio_base); |
2502 | err_release_pci: | 2510 | err_release_pci2: |
2503 | pci_release_regions(pdev); | 2511 | pci_release_region(pdev, 2); |
2512 | err_release_pci0: | ||
2513 | pci_release_region(pdev, 0); | ||
2504 | err_release_fb: | 2514 | err_release_fb: |
2505 | framebuffer_release(info); | 2515 | framebuffer_release(info); |
2506 | err_disable: | 2516 | err_disable: |
2507 | pci_disable_device(pdev); | 2517 | pci_disable_device(pdev); |
2508 | err_out: | 2518 | err_out: |
@@ -2548,7 +2558,8 @@ static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev) | |||
2548 | iounmap(rinfo->mmio_base); | 2558 | iounmap(rinfo->mmio_base); |
2549 | iounmap(rinfo->fb_base); | 2559 | iounmap(rinfo->fb_base); |
2550 | 2560 | ||
2551 | pci_release_regions(pdev); | 2561 | pci_release_region(pdev, 2); |
2562 | pci_release_region(pdev, 0); | ||
2552 | 2563 | ||
2553 | kfree(rinfo->mon1_EDID); | 2564 | kfree(rinfo->mon1_EDID); |
2554 | kfree(rinfo->mon2_EDID); | 2565 | kfree(rinfo->mon2_EDID); |