Skip to content

Commit 1a4dc68

Browse files
Dave JonesJeff Garzik
authored andcommitted
8139too: Fall back to PIO when MMIO fails.
Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
1 parent 152151d commit 1a4dc68

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/net/8139too.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
788788
DPRINTK("PIO region size == 0x%02X\n", pio_len);
789789
DPRINTK("MMIO region size == 0x%02lX\n", mmio_len);
790790

791+
retry:
791792
if (use_io) {
792793
/* make sure PCI base addr 0 is PIO */
793794
if (!(pio_flags & IORESOURCE_IO)) {
@@ -836,9 +837,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev,
836837
/* ioremap MMIO region */
837838
ioaddr = pci_iomap(pdev, 1, 0);
838839
if (ioaddr == NULL) {
839-
dev_err(&pdev->dev, "cannot remap MMIO, aborting\n");
840-
rc = -EIO;
841-
goto err_out;
840+
dev_err(&pdev->dev, "cannot remap MMIO, trying PIO\n");
841+
pci_release_regions(pdev);
842+
use_io = 1;
843+
goto retry;
842844
}
843845
dev->base_addr = (long) ioaddr;
844846
tp->regs_len = mmio_len;

0 commit comments

Comments
 (0)