* [PATCH] natsemi: fix MMIO for PPC 44x platforms
@ 2008-04-12 16:58 Sergei Shtylyov
2008-04-17 0:53 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Sergei Shtylyov @ 2008-04-12 16:58 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, linuxppc-dev
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>
---
Reposting the patch with the typecast, log, and summary corrected.
This is the same issue as the one that has been recently addressed by commits
3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with
64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix
kernel oops on PPC 44x). The patch has only been compile tested though...
drivers/net/natsemi.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
Index: linux-2.6/drivers/net/natsemi.c
===================================================================
--- linux-2.6.orig/drivers/net/natsemi.c
+++ linux-2.6/drivers/net/natsemi.c
@@ -786,7 +786,8 @@ static int __devinit natsemi_probe1 (str
struct netdev_private *np;
int i, option, irq, chip_idx = ent->driver_data;
static int find_cnt = -1;
- unsigned long iostart, iosize;
+ resource_size_t iostart;
+ unsigned long iosize;
void __iomem *ioaddr;
const int pcibar = 1; /* PCI base address register */
int prev_eedata;
@@ -946,10 +947,11 @@ static int __devinit natsemi_probe1 (str
goto err_create_file;
if (netif_msg_drv(np)) {
- printk(KERN_INFO "natsemi %s: %s at %#08lx "
+ printk(KERN_INFO "natsemi %s: %s at %#08llx "
"(%s), %s, IRQ %d",
- dev->name, natsemi_pci_info[chip_idx].name, iostart,
- pci_name(np->pci_dev), print_mac(mac, dev->dev_addr), irq);
+ dev->name, natsemi_pci_info[chip_idx].name,
+ (unsigned long long)iostart, pci_name(np->pci_dev),
+ print_mac(mac, dev->dev_addr), irq);
if (dev->if_port == PORT_TP)
printk(", port TP.\n");
else if (np->ignore_phy)
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] natsemi: fix MMIO for PPC 44x platforms
2008-04-12 16:58 [PATCH] natsemi: fix MMIO for PPC 44x platforms Sergei Shtylyov
@ 2008-04-17 0:53 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2008-04-17 0:53 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, linuxppc-dev
Sergei Shtylyov wrote:
> 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>
>
> ---
> Reposting the patch with the typecast, log, and summary corrected.
> This is the same issue as the one that has been recently addressed by commits
> 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with
> 64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix
> kernel oops on PPC 44x). The patch has only been compile tested though...
>
> drivers/net/natsemi.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-17 0:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-12 16:58 [PATCH] natsemi: fix MMIO for PPC 44x platforms Sergei Shtylyov
2008-04-17 0:53 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).