浏览代码

[SCSI] mptfusion: fix panic loading driver statically compiled

Adjust link ordering in the Makefile.  Also, the ioc->DoneCtx handles
for mptspi/mptfc in the message frame.  And I'm now not seeing the
panic.

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Moore, Eric Dean 20 年之前
父节点
当前提交
d335cc38c7

+ 2 - 2
drivers/message/fusion/Makefile

@@ -32,7 +32,7 @@
 
 
 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
 #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-} LSI_LOGIC
 
 
-obj-$(CONFIG_FUSION_SPI)	+= mptspi.o mptscsih.o mptbase.o
-obj-$(CONFIG_FUSION_FC)		+= mptfc.o mptscsih.o mptbase.o
+obj-$(CONFIG_FUSION_SPI)	+= mptbase.o mptscsih.o mptspi.o
+obj-$(CONFIG_FUSION_FC)		+= mptbase.o mptscsih.o mptfc.o
 obj-$(CONFIG_FUSION_CTL)	+= mptctl.o
 obj-$(CONFIG_FUSION_CTL)	+= mptctl.o
 obj-$(CONFIG_FUSION_LAN)	+= mptlan.o
 obj-$(CONFIG_FUSION_LAN)	+= mptlan.o

+ 5 - 12
drivers/message/fusion/mptbase.c

@@ -360,15 +360,8 @@ mpt_interrupt(int irq, void *bus_id, struct pt_regs *r)
 		}
 		}
 
 
 		if (freeme) {
 		if (freeme) {
-			unsigned long flags;
-
 			/*  Put Request back on FreeQ!  */
 			/*  Put Request back on FreeQ!  */
-			spin_lock_irqsave(&ioc->FreeQlock, flags);
-			list_add_tail(&mf->u.frame.linkage.list, &ioc->FreeQ);
-#ifdef MFCNT
-			ioc->mfcnt--;
-#endif
-			spin_unlock_irqrestore(&ioc->FreeQlock, flags);
+			mpt_free_msg_frame(ioc, mf);
 		}
 		}
 
 
 		mb();
 		mb();
@@ -735,8 +728,8 @@ mpt_get_msg_frame(int handle, MPT_ADAPTER *ioc)
 		mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;	/* byte */
 		mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;	/* byte */
 		req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
 		req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
 								/* u16! */
 								/* 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;
 		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 */
 		ioc->RequestNB[req_idx] = ioc->NB_for_64_byte_frame; /* Default, will be changed if necessary in SG generation */
 #ifdef MFCNT
 #ifdef MFCNT
@@ -782,8 +775,8 @@ mpt_put_msg_frame(int handle, MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf)
 	mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;		/* byte */
 	mf->u.frame.hwhdr.msgctxu.fld.cb_idx = handle;		/* byte */
 	req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
 	req_offset = (u8 *)mf - (u8 *)ioc->req_frames;
 								/* u16! */
 								/* 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;
 	mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0;
 
 
 #ifdef MPT_DEBUG_MSG_FRAME
 #ifdef MPT_DEBUG_MSG_FRAME

+ 2 - 2
drivers/message/fusion/mptbase.h

@@ -76,8 +76,8 @@
 #define COPYRIGHT	"Copyright (c) 1999-2005 " MODULEAUTHOR
 #define COPYRIGHT	"Copyright (c) 1999-2005 " MODULEAUTHOR
 #endif
 #endif
 
 
-#define MPT_LINUX_VERSION_COMMON	"3.03.00"
-#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.03.00"
+#define MPT_LINUX_VERSION_COMMON	"3.03.01"
+#define MPT_LINUX_PACKAGE_NAME		"@(#)mptlinux-3.03.01"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 #define WHAT_MAGIC_STRING		"@" "(" "#" ")"
 
 
 #define show_mptmod_ver(s,ver)  \
 #define show_mptmod_ver(s,ver)  \

+ 3 - 4
drivers/message/fusion/mptfc.c

@@ -166,6 +166,9 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return r;
 		return r;
 	
 	
 	ioc = pci_get_drvdata(pdev);
 	ioc = pci_get_drvdata(pdev);
+	ioc->DoneCtx = mptfcDoneCtx;
+	ioc->TaskCtx = mptfcTaskCtx;
+	ioc->InternalCtx = mptfcInternalCtx;
 
 
 	/*  Added sanity check on readiness of the MPT adapter.
 	/*  Added sanity check on readiness of the MPT adapter.
 	 */
 	 */
@@ -325,10 +328,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	hd->timer.data = (unsigned long) hd;
 	hd->timer.data = (unsigned long) hd;
 	hd->timer.function = mptscsih_timer_expired;
 	hd->timer.function = mptscsih_timer_expired;
 
 
-	ioc->DoneCtx = mptfcDoneCtx;
-	ioc->TaskCtx = mptfcTaskCtx;
-	ioc->InternalCtx = mptfcInternalCtx;
-
 	hd->mpt_pq_filter = mpt_pq_filter;
 	hd->mpt_pq_filter = mpt_pq_filter;
 
 
 	ddvprintk((MYIOC_s_INFO_FMT
 	ddvprintk((MYIOC_s_INFO_FMT

+ 3 - 4
drivers/message/fusion/mptspi.c

@@ -180,6 +180,9 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return r;
 		return r;
 	
 	
 	ioc = pci_get_drvdata(pdev);
 	ioc = pci_get_drvdata(pdev);
+	ioc->DoneCtx = mptspiDoneCtx;
+	ioc->TaskCtx = mptspiTaskCtx;
+	ioc->InternalCtx = mptspiInternalCtx;
 	
 	
 	/*  Added sanity check on readiness of the MPT adapter.
 	/*  Added sanity check on readiness of the MPT adapter.
 	 */
 	 */
@@ -395,10 +398,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	hd->scandv_wait_done = 0;
 	hd->scandv_wait_done = 0;
 	hd->last_queue_full = 0;
 	hd->last_queue_full = 0;
 
 
-	ioc->DoneCtx = mptspiDoneCtx;
-	ioc->TaskCtx = mptspiTaskCtx;
-	ioc->InternalCtx = mptspiInternalCtx;
-
 	error = scsi_add_host (sh, &ioc->pcidev->dev);
 	error = scsi_add_host (sh, &ioc->pcidev->dev);
 	if(error) {
 	if(error) {
 		dprintk((KERN_ERR MYNAM
 		dprintk((KERN_ERR MYNAM