aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@HansenPartnership.com>2008-08-22 16:15:22 -0500
committerTony Luck <tony.luck@intel.com>2008-08-25 11:23:13 -0700
commit8a549f8b581db95fec1e2d86ff857594fcfcd9db (patch)
treedbf33ff8ee4c20ba7737c2968d5c7188bc3c4dff /arch
parent42aca483ddee8888926d913b660e1dd38d748ba9 (diff)
[IA64] Fix __{in,out}s{w,l} to handle unaligned data
Some ia64 systems produce several repeats of kernel messages like this: kernel unaligned access to 0xe000000644220466, ip=0xa000000100516fa1 This was tracked to ide code using the __cmd[] field in "struct request" via the __outsw() function. __cmd[] is a char array, so is not guaranteed to be properly aligned when accessed as words. Tested-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/include/asm/io.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
index 260a85ac9d6..7f257507cd8 100644
--- a/arch/ia64/include/asm/io.h
+++ b/arch/ia64/include/asm/io.h
@@ -19,6 +19,8 @@
* Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
*/
+#include <asm/unaligned.h>
+
/* We don't use IO slowdowns on the ia64, but.. */
#define __SLOW_DOWN_IO do { } while (0)
#define SLOW_DOWN_IO do { } while (0)
@@ -241,7 +243,7 @@ __insw (unsigned long port, void *dst, unsigned long count)
unsigned short *dp = dst;
while (count--)
- *dp++ = platform_inw(port);
+ put_unaligned(platform_inw(port), dp++);
}
static inline void
@@ -250,7 +252,7 @@ __insl (unsigned long port, void *dst, unsigned long count)
unsigned int *dp = dst;
while (count--)
- *dp++ = platform_inl(port);
+ put_unaligned(platform_inl(port), dp++);
}
static inline void
@@ -268,7 +270,7 @@ __outsw (unsigned long port, const void *src, unsigned long count)
const unsigned short *sp = src;
while (count--)
- platform_outw(*sp++, port);
+ platform_outw(get_unaligned(sp++), port);
}
static inline void
@@ -277,7 +279,7 @@ __outsl (unsigned long port, const void *src, unsigned long count)
const unsigned int *sp = src;
while (count--)
- platform_outl(*sp++, port);
+ platform_outl(get_unaligned(sp++), port);
}
/*