Commit 5251bffc authored by Daniel Burcaw's avatar Daniel Burcaw Committed by Linus Torvalds

[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: default avatarDaniel Burcaw <dburcaw@terrasoftsolutions.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c5eb5c1e
...@@ -2312,19 +2312,27 @@ static int radeonfb_pci_register (struct pci_dev *pdev, ...@@ -2312,19 +2312,27 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
rinfo->mmio_base_phys = pci_resource_start (pdev, 2); rinfo->mmio_base_phys = pci_resource_start (pdev, 2);
/* request the mem regions */ /* request the mem regions */
ret = pci_request_regions(pdev, "radeonfb"); ret = pci_request_region(pdev, 0, "radeonfb framebuffer");
if (ret < 0) { if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot reserve PCI regions." printk( KERN_ERR "radeonfb (%s): cannot request region 0.\n",
" Someone already got them?\n", pci_name(rinfo->pdev)); pci_name(rinfo->pdev));
goto err_release_fb; goto err_release_fb;
} }
ret = pci_request_region(pdev, 2, "radeonfb mmio");
if (ret < 0) {
printk( KERN_ERR "radeonfb (%s): cannot request region 2.\n",
pci_name(rinfo->pdev));
goto err_release_pci0;
}
/* map the regions */ /* map the regions */
rinfo->mmio_base = ioremap(rinfo->mmio_base_phys, RADEON_REGSIZE); rinfo->mmio_base = ioremap(rinfo->mmio_base_phys, RADEON_REGSIZE);
if (!rinfo->mmio_base) { if (!rinfo->mmio_base) {
printk(KERN_ERR "radeonfb (%s): cannot map MMIO\n", pci_name(rinfo->pdev)); printk(KERN_ERR "radeonfb (%s): cannot map MMIO\n",
pci_name(rinfo->pdev));
ret = -EIO; ret = -EIO;
goto err_release_pci; goto err_release_pci2;
} }
rinfo->fb_local_base = INREG(MC_FB_LOCATION) << 16; rinfo->fb_local_base = INREG(MC_FB_LOCATION) << 16;
...@@ -2499,8 +2507,10 @@ static int radeonfb_pci_register (struct pci_dev *pdev, ...@@ -2499,8 +2507,10 @@ static int radeonfb_pci_register (struct pci_dev *pdev,
if (rinfo->bios_seg) if (rinfo->bios_seg)
radeon_unmap_ROM(rinfo, pdev); radeon_unmap_ROM(rinfo, pdev);
iounmap(rinfo->mmio_base); iounmap(rinfo->mmio_base);
err_release_pci: err_release_pci2:
pci_release_regions(pdev); pci_release_region(pdev, 2);
err_release_pci0:
pci_release_region(pdev, 0);
err_release_fb: err_release_fb:
framebuffer_release(info); framebuffer_release(info);
err_disable: err_disable:
...@@ -2548,7 +2558,8 @@ static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev) ...@@ -2548,7 +2558,8 @@ static void __devexit radeonfb_pci_unregister (struct pci_dev *pdev)
iounmap(rinfo->mmio_base); iounmap(rinfo->mmio_base);
iounmap(rinfo->fb_base); iounmap(rinfo->fb_base);
pci_release_regions(pdev); pci_release_region(pdev, 2);
pci_release_region(pdev, 0);
kfree(rinfo->mon1_EDID); kfree(rinfo->mon1_EDID);
kfree(rinfo->mon2_EDID); kfree(rinfo->mon2_EDID);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment