Commit 2f68dbbf authored by Robert Daniels's avatar Robert Daniels Committed by Deepak Saxena

[ARM] Fix VMALLOC range check in IXP4xx I/O routines

I found a problem in the implementation of io.h for the ixp425.
It wasn't letting me access memory at VMALLOC_START, only after it.
I've included a patch to fix this problem.  This patch is for the
2.4.x kernel, but it looks like it needs fixing in the 2.6.x kernel as
well.
Signed-off-by: default avatarDeepak Saxena <dsaxena@plexity.net>
parent 90a079b3
...@@ -73,7 +73,7 @@ __ixp4xx_iounmap(void *addr) ...@@ -73,7 +73,7 @@ __ixp4xx_iounmap(void *addr)
{ {
extern void __iounmap(void *addr); extern void __iounmap(void *addr);
if ((u32)addr > VMALLOC_START) if ((u32)addr >= VMALLOC_START)
__iounmap(addr); __iounmap(addr);
} }
...@@ -101,7 +101,7 @@ __ixp4xx_writeb(u8 value, u32 addr) ...@@ -101,7 +101,7 @@ __ixp4xx_writeb(u8 value, u32 addr)
{ {
u32 n, byte_enables, data; u32 n, byte_enables, data;
if (addr > VMALLOC_START) { if (addr >= VMALLOC_START) {
__raw_writeb(value, addr); __raw_writeb(value, addr);
return; return;
} }
...@@ -124,7 +124,7 @@ __ixp4xx_writew(u16 value, u32 addr) ...@@ -124,7 +124,7 @@ __ixp4xx_writew(u16 value, u32 addr)
{ {
u32 n, byte_enables, data; u32 n, byte_enables, data;
if (addr > VMALLOC_START) { if (addr >= VMALLOC_START) {
__raw_writew(value, addr); __raw_writew(value, addr);
return; return;
} }
...@@ -145,7 +145,7 @@ __ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count) ...@@ -145,7 +145,7 @@ __ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count)
static inline void static inline void
__ixp4xx_writel(u32 value, u32 addr) __ixp4xx_writel(u32 value, u32 addr)
{ {
if (addr > VMALLOC_START) { if (addr >= VMALLOC_START) {
__raw_writel(value, addr); __raw_writel(value, addr);
return; return;
} }
...@@ -165,7 +165,7 @@ __ixp4xx_readb(u32 addr) ...@@ -165,7 +165,7 @@ __ixp4xx_readb(u32 addr)
{ {
u32 n, byte_enables, data; u32 n, byte_enables, data;
if (addr > VMALLOC_START) if (addr >= VMALLOC_START)
return __raw_readb(addr); return __raw_readb(addr);
n = addr % 4; n = addr % 4;
...@@ -188,7 +188,7 @@ __ixp4xx_readw(u32 addr) ...@@ -188,7 +188,7 @@ __ixp4xx_readw(u32 addr)
{ {
u32 n, byte_enables, data; u32 n, byte_enables, data;
if (addr > VMALLOC_START) if (addr >= VMALLOC_START)
return __raw_readw(addr); return __raw_readw(addr);
n = addr % 4; n = addr % 4;
...@@ -211,7 +211,7 @@ __ixp4xx_readl(u32 addr) ...@@ -211,7 +211,7 @@ __ixp4xx_readl(u32 addr)
{ {
u32 data; u32 data;
if (addr > VMALLOC_START) if (addr >= VMALLOC_START)
return __raw_readl(addr); return __raw_readl(addr);
if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data)) if (ixp4xx_pci_read(addr, NP_CMD_MEMREAD, &data))
......
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