fix mpt fustion cylinders calculation for large disks
Subsystems (2)
RFC PATCH 1/1 fix mpt fustion cylinders calculation for large disks
mptscsih will cast a sector_t to an int which is causing cylinders to be zero in some cases. This patch just sets cylinders to the max value when the capacity is over the limit that the geometry struct can support. With the patch if access a large Fibre Channel disk using Emulex on a 64 bit system I get the same values as mpt fusion, but I am honestly not sure why mpt does their own geometry calculations for this case in the first place so I am only sending this as a RFC.
Also, I thought cylinders could be ignored by userspace but I am not sure where I read this and cannot seem to find it, so I ccd Andries who seems to post the most about such things (chances are they said it and I am misquiting them).
Patch was made against the scsi-misc tree.
drivers/message/fusion/mptscsih.c renamed from drivers/message/fusion/mptscsih.c.orig +8 -3
@@ -2107,12 +2107,17 @@ mptscsih_bios_param(struct scsi_device ** Handle extended translation size for logical drives * > 1Gb */ -if ((ulong )capacity >=0x200000 ) { +if (capacity >=0x200000 ) { heads =255 ; sectors =63 ; dummy = heads * sectors; - cylinders = capacity; -sector_div (cylinders,dummy); + +if (capacity >65535 *63 *255 ) + cylinders =65535 ; +else { + cylinders = capacity; +sector_div (cylinders,dummy); + } }/* return result */
PATCH 1/1 MPT FUSION driver causes panic on bootup on PPC 970 kernel
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
drivers/message/fusion/mptbase.c +5 -5
@@ -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 )