A PPC 970 kernel with the MPT FUSION driver configured in would cause
the kernel to panic. The problem occurs because of some apparently
incorrect logic dealing with the cpu_to_le* and le*_to_cpu routines.
Patch is attached. Comments?
mark
Index: linux-2.6.10/drivers/message/fusion/mptbase.c
===================================================================
--- linux-2.6.10.orig/drivers/message/fusion/mptbase.c
+++ linux-2.6.10/drivers/message/fusion/mptbase.c
@@ -813,8 +813,8 @@
mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
/* u16! */
- req_idx = cpu_to_le16(req_offset / ioc->req_sz);
- mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx;
+ req_idx = (req_offset / ioc->req_sz);
+ mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */
#ifdef MFCNT
@@ -860,8 +860,8 @@
mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle; /* byte */
req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
/* u16! */
- req_idx = cpu_to_le16(req_offset / ioc->req_sz);
- mf->u.frame.hwhdr.msgctxu.fld.req_idx = req_idx;
+ req_idx = (req_offset / ioc->req_sz);
+ mf->u.frame.hwhdr.msgctxu.fld.req_idx = cpu_to_le16(req_idx);
mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
#ifdef MPT_DEBUG_MSG_FRAME
@@ -2337,7 +2337,7 @@
return -55;
}
- r = sz = le32_to_cpu(facts->BlockSize);
+ r = sz = facts->BlockSize; /* U8! */
vv = ((63 / (sz * 4)) + 1) & 0x03;
ioc->NB_for_64_byte_frame = vv;
while ( sz )