linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] - fusion - several patchs from two weeks ago
@ 2006-01-31 18:20 Moore, Eric
  2006-02-01 10:35 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Moore, Eric @ 2006-01-31 18:20 UTC (permalink / raw)
  To: James Bottomley, linux-scsi

[-- Attachment #1: Type: text/plain, Size: 975 bytes --]

James:

Apparently in scsi-rc-fixes-2.6.diff:

You have picked up fusion patches from Jan 16, and
patches from Jan 25, however patch's posted in between
on Jan 17th were overlooked.  These are very important bug fix's.
Can you merge these into your tree?   I have attached a updated
patch that is rebased to work with your your lastest
scsi-rc-fixes.  Please apply.

Missing patches are:

[PATCH 1/3] fusion - unloading the driver results in panic - fix:
http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284707413&w=2

[PATCH 2/3] fusion - unloading the driver - only set asyn narrow for
configured devices
http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284725421&w=2

[PATCH 3/3] fusion - sanity check
http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284702520&w=2

[2.6 patch] drivers/message/fusion/mptfc.c: make 2 functions static
http://marc.theaimsgroup.com/?t=113763271300004&r=1&w=2

Signed-off-by: Eric Moore <Eric.Moore@lsil.com>

[-- Attachment #2: missing-bits.patch --]
[-- Type: application/octet-stream, Size: 7430 bytes --]

diff -uarN b/drivers/message/fusion/mptbase.c a/drivers/message/fusion/mptbase.c
--- b/drivers/message/fusion/mptbase.c	2006-01-31 10:36:21.000000000 -0700
+++ a/drivers/message/fusion/mptbase.c	2006-01-31 10:49:41.000000000 -0700
@@ -178,7 +178,7 @@
 static int	ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *evReply, int *evHandlers);
 static void	mpt_sp_ioc_info(MPT_ADAPTER *ioc, u32 ioc_status, MPT_FRAME_HDR *mf);
 static void	mpt_fc_log_info(MPT_ADAPTER *ioc, u32 log_info);
-static void	mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info);
+static void	mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info);
 static void	mpt_sas_log_info(MPT_ADAPTER *ioc, u32 log_info);
 
 /* module entry point */
@@ -317,7 +317,7 @@
 		if (ioc->bus_type == FC)
 			mpt_fc_log_info(ioc, log_info);
 		else if (ioc->bus_type == SPI)
-			mpt_sp_log_info(ioc, log_info);
+			mpt_spi_log_info(ioc, log_info);
 		else if (ioc->bus_type == SAS)
 			mpt_sas_log_info(ioc, log_info);
 	}
@@ -1448,6 +1448,7 @@
 
 	ioc->pci_irq = -1;
 	if (pdev->irq) {
+
 		if (mpt_msi_enable && !pci_enable_msi(pdev))
 			printk(MYIOC_s_INFO_FMT "PCI-MSI enabled\n", ioc->name);
 
@@ -1492,6 +1493,8 @@
 		free_irq(ioc->pci_irq, ioc);
 		if (mpt_msi_enable)
 			pci_disable_msi(pdev);
+		if (ioc->alt_ioc)
+			ioc->alt_ioc->alt_ioc = NULL;
 		iounmap(mem);
 		kfree(ioc);
 		pci_set_drvdata(pdev, NULL);
@@ -2168,6 +2171,10 @@
 	sz_last = ioc->alloc_total;
 	dprintk((KERN_INFO MYNAM ": %s: free'd %d of %d bytes\n",
 			ioc->name, sz_first-sz_last+(int)sizeof(*ioc), sz_first));
+
+	if (ioc->alt_ioc)
+		ioc->alt_ioc->alt_ioc = NULL;
+
 	kfree(ioc);
 }
 
@@ -6204,7 +6211,7 @@
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
- *	mpt_sp_log_info - Log information returned from SCSI Parallel IOC.
+ *	mpt_spi_log_info - Log information returned from SCSI Parallel IOC.
  *	@ioc: Pointer to MPT_ADAPTER structure
  *	@mr: Pointer to MPT reply frame
  *	@log_info: U32 LogInfo word from the IOC
@@ -6212,7 +6219,7 @@
  *	Refer to lsi/sp_log.h.
  */
 static void
-mpt_sp_log_info(MPT_ADAPTER *ioc, u32 log_info)
+mpt_spi_log_info(MPT_ADAPTER *ioc, u32 log_info)
 {
 	u32 info = log_info & 0x00FF0000;
 	char *desc = "unknown";
diff -uarN b/drivers/message/fusion/mptfc.c a/drivers/message/fusion/mptfc.c
--- b/drivers/message/fusion/mptfc.c	2006-01-31 10:36:21.000000000 -0700
+++ a/drivers/message/fusion/mptfc.c	2006-01-25 17:23:40.000000000 -0700
@@ -97,6 +97,7 @@
 static int mptfc_slave_alloc(struct scsi_device *sdev);
 static int mptfc_qcmd(struct scsi_cmnd *SCpnt,
 		      void (*done)(struct scsi_cmnd *));
+
 static void mptfc_target_destroy(struct scsi_target *starget);
 static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
 static void __devexit mptfc_remove(struct pci_dev *pdev);
@@ -154,7 +155,7 @@
 
 static struct scsi_transport_template *mptfc_transport_template = NULL;
 
-struct fc_function_template mptfc_transport_functions = {
+static struct fc_function_template mptfc_transport_functions = {
 	.dd_fcrport_size = 8,
 	.show_host_node_name = 1,
 	.show_host_port_name = 1,
@@ -514,7 +515,7 @@
  *	Return non-zero if allocation fails.
  *	Init memory once per LUN.
  */
-int
+static int
 mptfc_slave_alloc(struct scsi_device *sdev)
 {
 	MPT_SCSI_HOST		*hd;
diff -uarN b/drivers/message/fusion/mptscsih.c a/drivers/message/fusion/mptscsih.c
--- b/drivers/message/fusion/mptscsih.c	2006-01-31 10:36:21.000000000 -0700
+++ a/drivers/message/fusion/mptscsih.c	2006-01-31 10:55:26.000000000 -0700
@@ -158,7 +158,7 @@
 int		mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
 static int	mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *iocmd);
 static void	mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice);
-static void	mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget);
+static void	mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice);
 static int	mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id);
 
 #ifdef MPTSCSIH_ENABLE_DOMAIN_VALIDATION
@@ -560,11 +560,24 @@
 	MPT_SCSI_HOST	*hd;
 	SCSIIORequest_t	*pScsiReq;
 	SCSIIOReply_t	*pScsiReply;
-	u16		 req_idx;
+	u16		 req_idx, req_idx_MR;
 
 	hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
 
 	req_idx = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
+	req_idx_MR = (mr != NULL) ?
+	    le16_to_cpu(mr->u.frame.hwhdr.msgctxu.fld.req_idx) : req_idx;
+	if ((req_idx != req_idx_MR) ||
+	    (mf->u.frame.linkage.arg1 == 0xdeadbeaf)) {
+		printk(MYIOC_s_ERR_FMT "Received a mf that was already freed\n",
+		    ioc->name);
+		printk (MYIOC_s_ERR_FMT
+		    "req_idx=%x req_idx_MR=%x mf=%p mr=%p sc=%p\n",
+		    ioc->name, req_idx, req_idx_MR, mf, mr,
+		    hd->ScsiLookup[req_idx_MR]);
+		return 0;
+	}
+
 	sc = hd->ScsiLookup[req_idx];
 	if (sc == NULL) {
 		MPIHeader_t *hdr = (MPIHeader_t *)mf;
@@ -1729,7 +1742,7 @@
 		return 10;
 	case SPI:
 	default:
-		return 2;
+		return 5;
 	}
 }
 
@@ -1802,9 +1815,10 @@
 	hd->abortSCpnt = SCpnt;
 
 	vdev = SCpnt->device->hostdata;
+	/* set timeout in seconds */
 	retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
 		vdev->bus_id, vdev->target_id, vdev->lun,
-		ctx2abort, mptscsih_get_tm_timeout(ioc));
+		ctx2abort, mptscsih_get_tm_timeout(hd->ioc));
 
 	printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n",
 		hd->ioc->name,
@@ -2308,7 +2322,7 @@
 	vtarget->luns[0] &= ~(1 << vdevice->lun);
 	vtarget->num_luns--;
 	if (vtarget->num_luns == 0) {
-		mptscsih_negotiate_to_asyn_narrow(hd, vtarget);
+		mptscsih_negotiate_to_asyn_narrow(hd, vdevice);
 		if (hd->ioc->bus_type == SPI) {
 			if (mptscsih_is_phys_disk(hd->ioc, vtarget->target_id)) {
 				hd->ioc->spi_data.forceDv |= MPT_SCSICFG_RELOAD_IOC_PG3;
@@ -3899,8 +3913,9 @@
  *
  */
 static void
-mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtTarget *vtarget)
+mptscsih_negotiate_to_asyn_narrow(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
 {
+	VirtTarget		*vtarget = vdevice->vtarget;
 	MPT_ADAPTER		*ioc= hd->ioc;
 	SCSIDevicePage1_t	*pcfg1Data;
 	CONFIGPARMS		 cfg;
@@ -3910,7 +3925,8 @@
 	int			 requested, configuration, data,i;
 	u8			 flags, factor;
 
-	if (ioc->bus_type != SPI)
+	if ((ioc->bus_type != SPI) ||
+		(!vdevice->configured_lun))
 		return;
 
 	if (!ioc->spi_data.sdp1length)
@@ -3946,7 +3962,7 @@
 			}
 			mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
 				&configuration, flags);
-			dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC "
+			dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC "
 				"offset=0 negoFlags=%x request=%x config=%x\n",
 				id, flags, requested, configuration));
 			pcfg1Data->RequestedParameters = cpu_to_le32(requested);
@@ -3959,7 +3975,7 @@
 		flags = vtarget->negoFlags;
 		mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
 				&configuration, flags);
-		dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC "
+		dnegoprintk(("nego asyn narrow: id=%d width=0 factor=MPT_ASYNC "
 			"offset=0 negoFlags=%x request=%x config=%x\n",
 			vtarget->target_id, flags, requested, configuration));
 		pcfg1Data->RequestedParameters = cpu_to_le32(requested);
@@ -5657,5 +5673,4 @@
 EXPORT_SYMBOL(mptscsih_change_queue_depth);
 EXPORT_SYMBOL(mptscsih_timer_expired);
 EXPORT_SYMBOL(mptscsih_TMHandler);
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] - fusion - several patchs from two weeks ago
  2006-01-31 18:20 [PATCH] - fusion - several patchs from two weeks ago Moore, Eric
@ 2006-02-01 10:35 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2006-02-01 10:35 UTC (permalink / raw)
  To: Moore, Eric; +Cc: James Bottomley, linux-scsi

On Tue, Jan 31, 2006 at 11:20:22AM -0700, Moore, Eric wrote:
> James:
> 
> Apparently in scsi-rc-fixes-2.6.diff:
> 
> You have picked up fusion patches from Jan 16, and
> patches from Jan 25, however patch's posted in between
> on Jan 17th were overlooked.  These are very important bug fix's.
> Can you merge these into your tree?   I have attached a updated
> patch that is rebased to work with your your lastest
> scsi-rc-fixes.  Please apply.
> 
> Missing patches are:
> 
> [PATCH 1/3] fusion - unloading the driver results in panic - fix:
> http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284707413&w=2

this should go in for 2.6.16 still.  maybe without the gratious
s/mpt_sp_log_info/mpt_spi_log_info/g

> [PATCH 2/3] fusion - unloading the driver - only set asyn narrow for
> configured devices
> http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284725421&w=2

is this critical enough for 2.6.16?  otherwise the generic DV code should
take care of it.

> [PATCH 3/3] fusion - sanity check
> http://marc.theaimsgroup.com/?l=linux-scsi&m=113754284702520&w=2

looks good, but probably not critical for 2.6.16 (?)

> [2.6 patch] drivers/message/fusion/mptfc.c: make 2 functions static
> http://marc.theaimsgroup.com/?t=113763271300004&r=1&w=2

Obviously fine, but not critical.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-01 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-31 18:20 [PATCH] - fusion - several patchs from two weeks ago Moore, Eric
2006-02-01 10:35 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).