Re: I/O macros for alpha platform


From: Jouni Malinen (jkmaline_at_cc.hut.fi)
Date: 2002-05-09 16:31:31 UTC



On Wed, May 08, 2002 at 08:49:21AM -0400, kaman wrote:

> Kernel panic: outsw: memory not short aligned
> In interrupt handler - not syncing
>
> any ideas about this one? could I be compiling it incorrectly

Hmm.. The driver uses outsw() only from hfa384x_to_bap() and at least my test version seemed to always use at least 16-bit aligned memory addresses so that this error should not happen unless the compiler does not align structures/buffers for some reason. You could at least add following alignment verifications to the driver in order to confirm that it is really hostap_cs.o using misaligned outsw(). These changes should remove the kernel crash and only report the error and return failure code.

diff -u -u -p -r1.156 prism2.c

--- driver/modules/prism2.c	5 May 2002 10:34:22 -0000	1.156
+++ driver/modules/prism2.c	9 May 2002 16:25:39 -0000
@@ -436,6 +436,11 @@ int hfa384x_from_bap(struct net_device *
 	u16 d_off;
 	u16 *pos;
 
+	if (((unsigned long) buf) & 1) {
+		printk("from_bap(bap=%d buf=0x%p len=%d) ALIGN!\n",
+		       bap, buf, len);
+		return -1;
+	}
 	d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF;
 	pos = (u16 *) buf;
 
@@ -460,6 +465,11 @@ int hfa384x_to_bap(struct net_device *de
 	u16 d_off;
 	u16 *pos;
 
+	if (((unsigned long) buf) & 1) {
+		printk("to_bap(bap=%d buf=0x%p len=%d) ALIGN!\n",
+		       bap, buf, len);
+		return -1;
+	}
 	d_off = (bap == 1) ? HFA384X_DATA1_OFF : HFA384X_DATA0_OFF;
 	pos = (u16 *) buf;
 

-- 
Jouni Malinen                                            PGP id EFC895FA


This archive was generated by hypermail 2.1.4.