Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

natsemi: fix MMIO for PPC 44x platforms

The driver stores the PCI resource address into 'unsigned long' variable before
calling ioremap() on it. This warrants a kernel oops when the registers are
accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped
beyond 4 GB.

The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the
PCI memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of
this trick, having instead CONFIG_RESOURCES_64BIT enabled.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

authored by

Sergei Shtylyov and committed by
Jeff Garzik
703bb99c 406874a7

+6 -4
+6 -4
drivers/net/natsemi.c
··· 786 786 struct netdev_private *np; 787 787 int i, option, irq, chip_idx = ent->driver_data; 788 788 static int find_cnt = -1; 789 - unsigned long iostart, iosize; 789 + resource_size_t iostart; 790 + unsigned long iosize; 790 791 void __iomem *ioaddr; 791 792 const int pcibar = 1; /* PCI base address register */ 792 793 int prev_eedata; ··· 947 946 goto err_create_file; 948 947 949 948 if (netif_msg_drv(np)) { 950 - printk(KERN_INFO "natsemi %s: %s at %#08lx " 949 + printk(KERN_INFO "natsemi %s: %s at %#08llx " 951 950 "(%s), %s, IRQ %d", 952 - dev->name, natsemi_pci_info[chip_idx].name, iostart, 953 - pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq); 951 + dev->name, natsemi_pci_info[chip_idx].name, 952 + (unsigned long long)iostart, pci_name(np->pci_dev), 953 + print_mac(mac, dev->dev_addr), irq); 954 954 if (dev->if_port == PORT_TP) 955 955 printk(", port TP.\n"); 956 956 else if (np->ignore_phy)