Commit 1a4dc68b authored by Dave Jones's avatar Dave Jones Committed by Jeff Garzik

8139too: Fall back to PIO when MMIO fails.

Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent 152151da
...@@ -788,6 +788,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -788,6 +788,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
DPRINTK("PIO region size == 0x%02X\n", pio_len); DPRINTK("PIO region size == 0x%02X\n", pio_len);
DPRINTK("MMIO region size == 0x%02lX\n", mmio_len); DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
retry:
if (use_io) { if (use_io) {
/* make sure PCI base addr 0 is PIO */ /* make sure PCI base addr 0 is PIO */
if (!(pio_flags & IORESOURCE_IO)) { if (!(pio_flags & IORESOURCE_IO)) {
...@@ -836,9 +837,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, ...@@ -836,9 +837,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
/* ioremap MMIO region */ /* ioremap MMIO region */
ioaddr = pci_iomap(pdev, 1, 0); ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) { if (ioaddr == NULL) {
dev_err(&pdev->dev, "cannot remap MMIO, aborting\n"); dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
rc = -EIO; pci_release_regions(pdev);
goto err_out; use_io = 1;
goto retry;
} }
dev->base_addr = (long) ioaddr; dev->base_addr = (long) ioaddr;
tp->regs_len = mmio_len; tp->regs_len = mmio_len;
......
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