[ofa-general] [PATCH] ib_umad unaligned access on ia64

akepner at sgi.com akepner at sgi.com
Thu Aug 9 13:36:12 PDT 2007


We get lots of "kernel unaligned access" warnings from
this one on ia64.

 user_mad.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

Signed-off-by: Arthur Kepner <akepner at sgi.com>

--

--- ofa_kernel-1.2.orig/drivers/infiniband/core/user_mad.c	2007-06-21 07:38:47.000000000 -0700
+++ ofa_kernel-1.2/drivers/infiniband/core/user_mad.c	2007-08-09 12:46:57.582962328 -0700
@@ -48,6 +48,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/semaphore.h>
+#include <asm/unaligned.h>
 
 #include <rdma/ib_mad.h>
 #include <rdma/ib_user_mad.h>
@@ -536,7 +537,7 @@ static ssize_t ib_umad_write(struct file
 		tid = &((struct ib_mad_hdr *) packet->msg->mad)->tid;
 		*tid = cpu_to_be64(((u64) agent->hi_tid) << 32 |
 				   (be64_to_cpup(tid) & 0xffffffff));
-		rmpp_mad->mad_hdr.tid = *tid;
+		put_unaligned(*tid, (__u64*)&rmpp_mad->mad_hdr.tid);
 	}
 
 	spin_lock_irq(&file->send_lock);

-- 
Arthur




More information about the general mailing list