All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] scsi spi transport: SCSI domain validation after reset
@ 2007-02-07 23:51 Eric Moore
  2007-02-12 16:14 ` Mark Haverkamp
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Moore @ 2007-02-07 23:51 UTC (permalink / raw)
  To: James.Bottomley, markh, linux-scsi

> -----Original Message-----
> From: James Bottomley [mailto:James.Bottomley@SteelEye.com] 
> Sent: Monday, February 05, 2007 2:50 PM
> To: Mark Haverkamp
> Cc: linux-scsi; Moore, Eric
> Subject: Re: [PATCH] scsi spi transport: SCSI domain 
> validation after reset
> 
> On Mon, 2007-02-05 at 12:49 -0800, Mark Haverkamp wrote:
> > James,
> > 
> > Some months ago, I had problems with a mis-behaving disk that failed
> > domain validation on a fusion card resulting in an infinite loop of
> > domain validation.  At the time Eric proposed a patch to the mptspi
> > driver to reload devices with parameters previously 
> negotiated when a
> > reset occurred.  You indicated that a more generic solution 
> should be
> > done.
> > 
> > This patch updates spi_dv_device_internal() to check if domain
> > validation has already been performed on a device and just sets it
> > previously negotiated parameters.  This solved the "infinite domain
> > validation" loop for me when a reset is performed as a 
> result of command
> > timeout with the mis-behaving device.
> 
> Er,but this code basically disabled domain revalidation after a reset,
> doesn't it?  If we could do it that way, we could simply take 
> the calls
> to spi_dv_device() out of the fusion driver and instead set the
> parameters up in its place without having to modify the 
> transport class.
> 

Here is a patch that does exactly that.

After host reset, the device are programmed to default asyn narrow nego.
We need to reprogram the parameter back to previous values.  If the host
reset is called as a result of spi_dv_device() commands timing out, its
possible to get into an infinite loop of dv to host reset.  This will
prevent that case, as we merely program old values.  If host reset is
called outside context of domain validation, then we can  call
spi_dv_device. Please apply.

This applies over scsi-misc tree.

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


diff -uarpN b/drivers/message/fusion/mptbase.h a/drivers/message/fusion/mptbase.h
--- b/drivers/message/fusion/mptbase.h	2007-02-07 15:20:35.000000000 -0700
+++ a/drivers/message/fusion/mptbase.h	2007-02-07 12:21:33.000000000 -0700
@@ -994,6 +994,7 @@ typedef struct _MPT_SCSI_HOST {
 	int			  scandv_wait_done;
 	long			  last_queue_full;
 	u16			  tm_iocstatus;
+	u16			  spi_pending;
 	struct list_head	  target_reset_list;
 } MPT_SCSI_HOST;
 
diff -uarpN b/drivers/message/fusion/mptspi.c a/drivers/message/fusion/mptspi.c
--- b/drivers/message/fusion/mptspi.c	2007-02-07 15:20:35.000000000 -0700
+++ a/drivers/message/fusion/mptspi.c	2007-02-07 12:24:35.000000000 -0700
@@ -678,7 +678,9 @@ static void mptspi_dv_device(struct _MPT
 		return;
 	}
 
+	hd->spi_pending |= (1 << sdev->id);
 	spi_dv_device(sdev);
+	hd->spi_pending &= ~(1 << sdev->id);
 
 	if (sdev->channel == 1 &&
 	    mptscsih_quiesce_raid(hd, 0, vtarget->channel, vtarget->id) < 0)
@@ -1204,11 +1206,27 @@ mptspi_dv_renegotiate_work(struct work_s
 		container_of(work, struct work_queue_wrapper, work);
 	struct _MPT_SCSI_HOST *hd = wqw->hd;
 	struct scsi_device *sdev;
+	struct scsi_target *starget;
+	struct _CONFIG_PAGE_SCSI_DEVICE_1 pg1;
+	u32 nego;
 
 	kfree(wqw);
 
-	shost_for_each_device(sdev, hd->ioc->sh)
-		mptspi_dv_device(hd, sdev);
+	if (hd->spi_pending) {
+		shost_for_each_device(sdev, hd->ioc->sh) {
+			if  (hd->spi_pending & (1 << sdev->id))
+				continue;
+			starget = scsi_target(sdev);
+			nego = mptspi_getRP(starget);
+			pg1.RequestedParameters = cpu_to_le32(nego);
+			pg1.Reserved = 0;
+			pg1.Configuration = 0;
+			mptspi_write_spi_device_pg1(starget, &pg1);
+		}
+	} else {
+		shost_for_each_device(sdev, hd->ioc->sh)
+			mptspi_dv_device(hd, sdev);
+	}
 }
 
 static void
@@ -1454,6 +1472,7 @@ mptspi_probe(struct pci_dev *pdev, const
 	init_waitqueue_head(&hd->scandv_waitq);
 	hd->scandv_wait_done = 0;
 	hd->last_queue_full = 0;
+	hd->spi_pending = 0;
 
 	/* Some versions of the firmware don't support page 0; without
 	 * that we can't get the parameters */


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

* RE: [PATCH] scsi spi transport: SCSI domain validation after reset
  2007-02-07 23:51 [PATCH] scsi spi transport: SCSI domain validation after reset Eric Moore
@ 2007-02-12 16:14 ` Mark Haverkamp
  2007-02-12 21:45   ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Haverkamp @ 2007-02-12 16:14 UTC (permalink / raw)
  To: Eric Moore; +Cc: James.Bottomley, linux-scsi

On Wed, 2007-02-07 at 16:51 -0700, Eric Moore wrote:
> > -----Original Message-----
> > From: James Bottomley [mailto:James.Bottomley@SteelEye.com] 
> > Sent: Monday, February 05, 2007 2:50 PM
> > To: Mark Haverkamp
> > Cc: linux-scsi; Moore, Eric
> > Subject: Re: [PATCH] scsi spi transport: SCSI domain 
> > validation after reset
> > 
> > On Mon, 2007-02-05 at 12:49 -0800, Mark Haverkamp wrote:
> > > James,
> > > 
> > > Some months ago, I had problems with a mis-behaving disk that failed
> > > domain validation on a fusion card resulting in an infinite loop of
> > > domain validation.  At the time Eric proposed a patch to the mptspi
> > > driver to reload devices with parameters previously 
> > negotiated when a
> > > reset occurred.  You indicated that a more generic solution 
> > should be
> > > done.
> > > 
> > > This patch updates spi_dv_device_internal() to check if domain
> > > validation has already been performed on a device and just sets it
> > > previously negotiated parameters.  This solved the "infinite domain
> > > validation" loop for me when a reset is performed as a 
> > result of command
> > > timeout with the mis-behaving device.
> > 
> > Er,but this code basically disabled domain revalidation after a reset,
> > doesn't it?  If we could do it that way, we could simply take 
> > the calls
> > to spi_dv_device() out of the fusion driver and instead set the
> > parameters up in its place without having to modify the 
> > transport class.
> > 
> 
> Here is a patch that does exactly that.
> 
> After host reset, the device are programmed to default asyn narrow nego.
> We need to reprogram the parameter back to previous values.  If the host
> reset is called as a result of spi_dv_device() commands timing out, its
> possible to get into an infinite loop of dv to host reset.  This will
> prevent that case, as we merely program old values.  If host reset is
> called outside context of domain validation, then we can  call
> spi_dv_device. Please apply.
> 
> This applies over scsi-misc tree.
> 
> Signed-off-by: Eric Moore <Eric.Moore@lsi.com>

[ ... ]

This patch fixed my looping DV problem.

Mark.

-- 
Mark Haverkamp <markh@linux-foundation.org>


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

* RE: [PATCH] scsi spi transport: SCSI domain validation after reset
  2007-02-12 16:14 ` Mark Haverkamp
@ 2007-02-12 21:45   ` James Bottomley
  2007-02-12 23:00     ` Mark Haverkamp
  0 siblings, 1 reply; 7+ messages in thread
From: James Bottomley @ 2007-02-12 21:45 UTC (permalink / raw)
  To: Mark Haverkamp; +Cc: Eric Moore, linux-scsi

On Mon, 2007-02-12 at 08:14 -0800, Mark Haverkamp wrote:
> This patch fixed my looping DV problem.

As far as I can tell, this is identical to Eric's patch, but is done
using the existing dv_in_progress flag ... can you test it out and see
if it actually works?

Thanks,

James
Index: linux-2.6/drivers/scsi/scsi_transport_spi.c
===================================================================
--- linux-2.6.orig/drivers/scsi/scsi_transport_spi.c	2007-02-11 14:16:51.000000000 -0600
+++ linux-2.6/drivers/scsi/scsi_transport_spi.c	2007-02-12 15:20:59.000000000 -0600
@@ -787,6 +787,7 @@ spi_dv_device_internal(struct scsi_devic
 	struct scsi_target *starget = sdev->sdev_target;
 	struct Scsi_Host *shost = sdev->host;
 	int len = sdev->inquiry_len;
+
 	/* first set us up for narrow async */
 	DV_SET(offset, 0);
 	DV_SET(width, 0);
@@ -917,8 +918,25 @@ spi_dv_device(struct scsi_device *sdev)
 	if (unlikely(scsi_device_get(sdev)))
 		return;
 
-	if (unlikely(spi_dv_in_progress(starget)))
+	if (unlikely(spi_dv_in_progress(starget))) {
+		/*
+		 * If DV is already pending, just make sure the device
+		 * has all the parameters set (in case this is the
+		 * result of a reset during the in progress DV)
+		 */
+		DV_SET(dt, spi_dt(starget));
+		DV_SET(iu, spi_iu(starget));
+		DV_SET(width, spi_width(starget));
+		DV_SET(offset, spi_offset(starget));
+		DV_SET(period, spi_period(starget));
+		DV_SET(qas, spi_qas(starget));
+		DV_SET(rd_strm, spi_rd_strm(starget));
+		DV_SET(wr_flow, spi_wr_flow(starget));
+		DV_SET(rti, spi_rti(starget));
+		DV_SET(pcomp_en, spi_pcomp_en(starget));
+		scsi_device_put(sdev);
 		return;
+	}
 	spi_dv_in_progress(starget) = 1;
 
 	buffer = kzalloc(len, GFP_KERNEL);



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

* RE: [PATCH] scsi spi transport: SCSI domain validation after reset
  2007-02-12 21:45   ` James Bottomley
@ 2007-02-12 23:00     ` Mark Haverkamp
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Haverkamp @ 2007-02-12 23:00 UTC (permalink / raw)
  To: James Bottomley; +Cc: Eric Moore, linux-scsi

On Mon, 2007-02-12 at 15:45 -0600, James Bottomley wrote:
> On Mon, 2007-02-12 at 08:14 -0800, Mark Haverkamp wrote:
> > This patch fixed my looping DV problem.
> 
> As far as I can tell, this is identical to Eric's patch, but is done
> using the existing dv_in_progress flag ... can you test it out and see
> if it actually works?

No, it still loops doing dv.  I think that the problem is that I have
two devices that won't run at advertised speeds.  Target 0 and Target 8.
When Target 0 causes a reset,  there is no problem yet.  Later when
Target 8 causes a reset and dv is re-scheduled on Targets 0-8 is when
the problem starts.  Target 0 is no longer pending so it will start dv
and fail causing a reset scheduling another round of dv.  Then 8 will
fail again since by this time it isn't pending anymore, etc..

Here is a section of the messages file. The machine is still looping.

Feb 12 14:12:26 odt2-006 kernel: SCSI subsystem initialized
Feb 12 14:12:27 odt2-006 kernel: Fusion MPT base driver 3.04.04
Feb 12 14:12:27 odt2-006 kernel: Copyright (c) 1999-2007 LSI Logic Corporation
Feb 12 14:12:27 odt2-006 kernel: Fusion MPT misc device (ioctl) driver 3.04.04
Feb 12 14:12:27 odt2-006 kernel: mptctl: Registered with Fusion MPT base driver
Feb 12 14:12:27 odt2-006 kernel: mptctl: /dev/mptctl @ (major,minor=10,220)
Feb 12 14:12:38 odt2-006 kernel: Fusion MPT SPI Host driver 3.04.04
Feb 12 14:12:38 odt2-006 kernel: ACPI: PCI Interrupt 0000:03:03.0[A] -> GSI 27 (level, low) -> IRQ 27
Feb 12 14:12:38 odt2-006 kernel: mptbase: Initiating ioc0 bringup
Feb 12 14:12:38 odt2-006 kernel: ioc0: 53C1030: Capabilities={Initiator}
Feb 12 14:12:39 odt2-006 kernel: scsi0 : ioc0: LSI53C1030, FwRev=01030a00h, Ports=1, MaxQ=222, IRQ=27
Feb 12 14:12:40 odt2-006 kernel: scsi 0:0:0:0: Direct-Access     HP 18.2G MAP3367NC#HJ     HPC6 PQ: 0 ANSI: 3
Feb 12 14:12:40 odt2-006 kernel:  target0:0:0: Beginning Domain Validation
Feb 12 14:12:50 odt2-006 kernel: mptscsih: ioc0: attempting task abort! (sc=ffff810076871b00)
Feb 12 14:12:50 odt2-006 kernel: scsi 0:0:0:0: 
Feb 12 14:12:50 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:12:52 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:13:16 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:13:16 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076871b00)
Feb 12 14:13:16 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076871b00)
Feb 12 14:13:16 odt2-006 kernel: scsi 0:0:0:0: 
Feb 12 14:13:16 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:13:16 odt2-006 kernel:  target0:0:0: asynchronous
Feb 12 14:13:16 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076871b00)
Feb 12 14:13:26 odt2-006 kernel: mptscsih: ioc0: attempting task abort! (sc=ffff810076871b00)
Feb 12 14:13:26 odt2-006 kernel: scsi 0:0:0:0: 
Feb 12 14:13:26 odt2-006 kernel:         command: Test Unit Ready: 00 00 00 00 00 00
Feb 12 14:13:28 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:13:51 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:13:51 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076871b00)
Feb 12 14:13:51 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076871b00)
Feb 12 14:13:51 odt2-006 kernel: scsi 0:0:0:0: 
Feb 12 14:13:51 odt2-006 kernel:         command: Test Unit Ready: 00 00 00 00 00 00
Feb 12 14:13:51 odt2-006 kernel:  target0:0:0: asynchronous
Feb 12 14:13:51 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076871b00)
Feb 12 14:13:51 odt2-006 kernel: mptscsih: ioc0: attempting bus reset! (sc=ffff810076871b00)
Feb 12 14:13:51 odt2-006 kernel: scsi 0:0:0:0: 
Feb 12 14:13:51 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:13:52 odt2-006 kernel: mptscsih: ioc0: bus reset: SUCCESS (sc=ffff810076871b00)
Feb 12 14:14:02 odt2-006 kernel:  target0:0:0: Domain Validation detected failure, dropping back
Feb 12 14:14:02 odt2-006 kernel:  target0:0:0: Domain Validation skipping write tests
Feb 12 14:14:02 odt2-006 kernel:  target0:0:0: Ending Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:0: asynchronous
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:1:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:14:02 odt2-006 kernel:  target0:0:1: Beginning Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:1: Ending Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:1: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:2:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:14:02 odt2-006 kernel:  target0:0:2: Beginning Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:2: Ending Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:2: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:0:0: Attached scsi generic sg0 type 0
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:1:0: Attached scsi generic sg1 type 0
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:2:0: Attached scsi generic sg2 type 0
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:3:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:14:02 odt2-006 kernel:  target0:0:3: Beginning Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:3: Ending Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:3: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:3:0: Attached scsi generic sg3 type 0
Feb 12 14:14:02 odt2-006 kernel: SCSI device sda: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:5:0: Processor         HP       D5989C           1.06 PQ: 0 ANSI: 2
Feb 12 14:14:02 odt2-006 kernel:  target0:0:5: Beginning Domain Validation
Feb 12 14:14:02 odt2-006 kernel: sda: Write Protect is off
Feb 12 14:14:02 odt2-006 kernel:  target0:0:5: Ending Domain Validation
Feb 12 14:14:02 odt2-006 kernel:  target0:0:5: asynchronous
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:5:0: Attached scsi generic sg4 type 3
Feb 12 14:14:02 odt2-006 kernel: SCSI device sda: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:14:02 odt2-006 kernel: SCSI device sda: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:14:02 odt2-006 kernel: scsi 0:0:8:0: Direct-Access     HP 18.2G MAP3367NC#HJ     HPC6 PQ: 0 ANSI: 3
Feb 12 14:14:02 odt2-006 kernel:  target0:0:8: Beginning Domain Validation
Feb 12 14:14:02 odt2-006 kernel: sda: Write Protect is off
Feb 12 14:14:02 odt2-006 kernel: SCSI device sda: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:15:09 odt2-006 kernel:  sda:<4>mptscsih: ioc0: attempting task abort! (sc=ffff810076871b00)
Feb 12 14:15:09 odt2-006 kernel: scsi 0:0:8:0: 
Feb 12 14:15:09 odt2-006 kernel:         command: Test Unit Ready: 00 00 00 00 00 00
Feb 12 14:15:11 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:15:34 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:15:34 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076871b00)
Feb 12 14:15:34 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076871b00)
Feb 12 14:15:34 odt2-006 kernel: scsi 0:0:8:0: 
Feb 12 14:15:34 odt2-006 kernel:         command: Test Unit Ready: 00 00 00 00 00 00
Feb 12 14:15:34 odt2-006 kernel:  target0:0:0: Beginning Domain Validation
Feb 12 14:15:35 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076871b00)
Feb 12 14:15:35 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076871b00)
Feb 12 14:15:35 odt2-006 kernel: scsi 0:0:8:0: 
Feb 12 14:15:35 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:15:35 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076871b00)
Feb 12 14:15:35 odt2-006 kernel:  target0:0:8: Domain Validation detected failure, dropping back
Feb 12 14:15:35 odt2-006 kernel:  target0:0:8: Domain Validation skipping write tests
Feb 12 14:15:35 odt2-006 kernel:  target0:0:8: Ending Domain Validation
Feb 12 14:15:35 odt2-006 kernel:  target0:0:8: asynchronous
Feb 12 14:15:35 odt2-006 kernel: scsi 0:0:8:0: Attached scsi generic sg5 type 0
Feb 12 14:15:35 odt2-006 kernel: scsi 0:0:9:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:15:35 odt2-006 kernel:  target0:0:9: Beginning Domain Validation
Feb 12 14:15:35 odt2-006 kernel:  sda1
Feb 12 14:15:35 odt2-006 kernel: sd 0:0:0:0: Attached scsi disk sda
Feb 12 14:15:35 odt2-006 kernel: SCSI device sdb: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:05 odt2-006 kernel: mptscsih: ioc0: attempting task abort! (sc=ffff810076871940)
Feb 12 14:16:05 odt2-006 kernel: sd 0:0:0:0: 
Feb 12 14:16:05 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:16:07 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:16:30 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:16:30 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076871940)
Feb 12 14:16:30 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076871940)
Feb 12 14:16:30 odt2-006 kernel: sd 0:0:0:0: 
Feb 12 14:16:30 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:16:30 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076871940)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:9:0: Write Buffer failure 80000
Feb 12 14:16:30 odt2-006 kernel:  target0:0:0: Domain Validation detected failure, dropping back
Feb 12 14:16:30 odt2-006 kernel:  target0:0:9: Domain Validation detected failure, dropping back
Feb 12 14:16:30 odt2-006 kernel:  target0:0:0: Domain Validation skipping write tests
Feb 12 14:16:30 odt2-006 kernel:  target0:0:0: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:0: asynchronous
Feb 12 14:16:30 odt2-006 kernel:  target0:0:9: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:9: asynchronous
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:9:0: Attached scsi generic sg6 type 0
Feb 12 14:16:30 odt2-006 kernel: sdb: Write Protect is off
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:10:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:10: Beginning Domain Validation
Feb 12 14:16:30 odt2-006 kernel: SCSI device sdb: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:30 odt2-006 kernel: SCSI device sdb: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:30 odt2-006 kernel: sdb: Write Protect is off
Feb 12 14:16:30 odt2-006 kernel: SCSI device sdb: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:30 odt2-006 kernel:  sdb:<6> target0:0:10: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:10: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:10:0: Attached scsi generic sg7 type 0
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:11:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:11: Beginning Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:11: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:11: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:11:0: Attached scsi generic sg8 type 0
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:12:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:12: Beginning Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:12: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:12: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:12:0: Attached scsi generic sg9 type 0
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:13:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:13: Beginning Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:13: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:13: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:13:0: Attached scsi generic sg10 type 0
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:14:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:14: Beginning Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:14: Ending Domain Validation
Feb 12 14:16:30 odt2-006 kernel:  target0:0:14: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:14:0: Attached scsi generic sg11 type 0
Feb 12 14:16:30 odt2-006 kernel: scsi 0:0:15:0: Direct-Access     HP       18.2GB C 80-H008 H008 PQ: 0 ANSI: 2
Feb 12 14:16:30 odt2-006 kernel:  target0:0:15: Beginning Domain Validation
Feb 12 14:16:31 odt2-006 kernel:  target0:0:15: Ending Domain Validation
Feb 12 14:16:31 odt2-006 kernel:  target0:0:15: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:31 odt2-006 kernel: scsi 0:0:15:0: Attached scsi generic sg12 type 0
Feb 12 14:16:31 odt2-006 kernel: ACPI: PCI Interrupt 0000:03:03.1[B] -> GSI 24 (level, low) -> IRQ 24
Feb 12 14:16:31 odt2-006 kernel: mptbase: Initiating ioc1 bringup
Feb 12 14:16:31 odt2-006 kernel:  target0:0:1: Beginning Domain Validation
Feb 12 14:16:31 odt2-006 kernel:  target0:0:1: mpt_config failed
Feb 12 14:16:31 odt2-006 kernel:  target0:0:1: mpt_config failed
Feb 12 14:16:31 odt2-006 kernel: ioc1: 53C1030: Capabilities={Initiator}
Feb 12 14:16:32 odt2-006 kernel: scsi1 : ioc1: LSI53C1030, FwRev=01030a00h, Ports=1, MaxQ=222, IRQ=24
Feb 12 14:16:32 odt2-006 kernel:  target0:0:1: Ending Domain Validation
Feb 12 14:16:32 odt2-006 kernel:  target0:0:1: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:32 odt2-006 kernel:  target0:0:2: Beginning Domain Validation
Feb 12 14:16:32 odt2-006 kernel:  sdb1
Feb 12 14:16:32 odt2-006 kernel: sd 0:0:1:0: Attached scsi disk sdb
Feb 12 14:16:32 odt2-006 kernel: SCSI device sdc: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:32 odt2-006 kernel: sdc: Write Protect is off
Feb 12 14:16:32 odt2-006 kernel: SCSI device sdc: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:32 odt2-006 kernel: SCSI device sdc: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:32 odt2-006 kernel: sdc: Write Protect is off
Feb 12 14:16:32 odt2-006 kernel: SCSI device sdc: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:32 odt2-006 kernel:  sdc:<6> target0:0:2: Ending Domain Validation
Feb 12 14:16:32 odt2-006 kernel:  target0:0:2: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:32 odt2-006 kernel:  target0:0:3: Beginning Domain Validation
Feb 12 14:16:32 odt2-006 kernel:  sdc1
Feb 12 14:16:32 odt2-006 kernel: sd 0:0:2:0: Attached scsi disk sdc
Feb 12 14:16:32 odt2-006 kernel: SCSI device sdd: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:33 odt2-006 kernel: sdd: Write Protect is off
Feb 12 14:16:33 odt2-006 kernel:  target0:0:3: Ending Domain Validation
Feb 12 14:16:33 odt2-006 kernel:  target0:0:3: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:16:33 odt2-006 kernel:  target0:0:5: Beginning Domain Validation
Feb 12 14:16:33 odt2-006 kernel: SCSI device sdd: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:33 odt2-006 kernel: SCSI device sdd: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:16:33 odt2-006 kernel:  target0:0:5: Ending Domain Validation
Feb 12 14:16:33 odt2-006 kernel:  target0:0:5: asynchronous
Feb 12 14:16:33 odt2-006 kernel:  target0:0:8: Beginning Domain Validation
Feb 12 14:16:33 odt2-006 kernel: sdd: Write Protect is off
Feb 12 14:16:33 odt2-006 kernel: SCSI device sdd: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:16:33 odt2-006 kernel:  sdd: sdd1
Feb 12 14:16:33 odt2-006 kernel: sd 0:0:3:0: Attached scsi disk sdd
Feb 12 14:16:37 odt2-006 kernel: ACPI: PCI Interrupt 0000:02:01.0[A] -> GSI 29 (level, low) -> IRQ 29
Feb 12 14:16:37 odt2-006 kernel: mptbase: Initiating ioc2 bringup
Feb 12 14:16:37 odt2-006 kernel: ioc2: 53C1030: Capabilities={Initiator}
Feb 12 14:16:38 odt2-006 kernel: scsi2 : ioc2: LSI53C1030, FwRev=01030600h, Ports=1, MaxQ=255, IRQ=29
Feb 12 14:16:42 odt2-006 kernel: ACPI: PCI Interrupt 0000:02:01.1[B] -> GSI 30 (level, low) -> IRQ 30
Feb 12 14:16:42 odt2-006 kernel: mptbase: Initiating ioc3 bringup
Feb 12 14:16:42 odt2-006 kernel: ioc3: 53C1030: Capabilities={Initiator}
Feb 12 14:16:43 odt2-006 kernel: scsi3 : ioc3: LSI53C1030, FwRev=01030600h, Ports=1, MaxQ=255, IRQ=30
Feb 12 14:17:33 odt2-006 kernel: mptscsih: ioc0: attempting task abort! (sc=ffff810076f66b40)
Feb 12 14:17:33 odt2-006 kernel: sd 0:0:3:0: 
Feb 12 14:17:33 odt2-006 kernel:         command: Inquiry: 12 01 00 00 fe 00
Feb 12 14:17:35 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:17:59 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:17:59 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076f66b40)
Feb 12 14:17:59 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076f66b40)
Feb 12 14:17:59 odt2-006 kernel: sd 0:0:3:0: 
Feb 12 14:17:59 odt2-006 kernel:         command: Inquiry: 12 01 00 00 fe 00
Feb 12 14:17:59 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076f66b40)
Feb 12 14:17:59 odt2-006 kernel:  target0:0:8: Domain Validation detected failure, dropping back
Feb 12 14:17:59 odt2-006 kernel: SCSI device sde: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:17:59 odt2-006 kernel: sde: Write Protect is off
Feb 12 14:17:59 odt2-006 kernel:  target0:0:8: Domain Validation skipping write tests
Feb 12 14:17:59 odt2-006 kernel:  target0:0:8: Ending Domain Validation
Feb 12 14:17:59 odt2-006 kernel:  target0:0:8: asynchronous
Feb 12 14:17:59 odt2-006 kernel:  target0:0:9: Beginning Domain Validation
Feb 12 14:17:59 odt2-006 kernel: SCSI device sde: write cache: disabled, read cache: enabled, supports DPO and FUA
Feb 12 14:17:59 odt2-006 kernel: SCSI device sde: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:17:59 odt2-006 kernel: sde: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sde: write cache: disabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel:  sde:<6> target0:0:9: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:9: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:10: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  sde1
Feb 12 14:18:00 odt2-006 kernel: sd 0:0:8:0: Attached scsi disk sde
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdf: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:10: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:10: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:11: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: sdf: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdf: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdf: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel: sdf: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel:  target0:0:11: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:11: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:12: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdf: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel:  sdf: sdf1
Feb 12 14:18:00 odt2-006 kernel: sd 0:0:9:0: Attached scsi disk sdf
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdg: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel: sdg: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdg: write cache: disabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdg: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:12: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:12: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:13: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: sdg: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdg: write cache: disabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel:  sdg: sdg1
Feb 12 14:18:00 odt2-006 kernel: sd 0:0:10:0: Attached scsi disk sdg
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdh: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel: sdh: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdh: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdh: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel: sdh: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel:  target0:0:13: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:13: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:14: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdh: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel:  sdh: sdh1
Feb 12 14:18:00 odt2-006 kernel: sd 0:0:11:0: Attached scsi disk sdh
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdi: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:14: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:14: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:15: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: sdi: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel:  target0:0:15: Ending Domain Validation
Feb 12 14:18:00 odt2-006 kernel:  target0:0:15: FAST-80 WIDE SCSI 160.0 MB/s DT (12.5 ns, offset 126)
Feb 12 14:18:00 odt2-006 kernel:  target0:0:0: Beginning Domain Validation
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdi: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdi: 35566480 512-byte hdwr sectors (18210 MB)
Feb 12 14:18:00 odt2-006 kernel: sdi: Write Protect is off
Feb 12 14:18:00 odt2-006 kernel: SCSI device sdi: write cache: enabled, read cache: enabled, supports DPO and FUA
Feb 12 14:19:10 odt2-006 kernel:  sdi:<4>mptscsih: ioc0: attempting task abort! (sc=ffff810076f66d00)
Feb 12 14:19:10 odt2-006 kernel: sd 0:0:0:0: 
Feb 12 14:19:10 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:19:12 odt2-006 kernel: mptbase: Initiating ioc0 recovery
Feb 12 14:19:36 odt2-006 kernel: mptscsih: ioc0: Issue of TaskMgmt failed!
Feb 12 14:19:36 odt2-006 kernel: mptscsih: ioc0: task abort: FAILED (sc=ffff810076f66d00)
Feb 12 14:19:36 odt2-006 kernel:  target0:0:0: asynchronous
Feb 12 14:19:36 odt2-006 kernel:  target0:0:1: Beginning Domain Validation
Feb 12 14:19:36 odt2-006 kernel: mptscsih: ioc0: attempting target reset! (sc=ffff810076f66d00)
Feb 12 14:19:36 odt2-006 kernel: sd 0:0:0:0: 
Feb 12 14:19:36 odt2-006 kernel:         command: Inquiry: 12 00 00 00 60 00
Feb 12 14:19:36 odt2-006 kernel: mptscsih: ioc0: target reset: SUCCESS (sc=ffff810076f66d00)
Feb 12 14:19:46 odt2-006 kernel: mptscsih: ioc0: attempting task abort! (sc=ffff810076f66d00)
Feb 12 14:19:46 odt2-006 kernel: sd 0:0:0:0: 
Feb 12 14:19:46 odt2-006 kernel:         command: Test Unit Ready: 00 00 00 00 00 00
Feb 12 14:19:48 odt2-006 kernel: mptbase: Initiating ioc0 recovery

> 
> Thanks,
> 
> James
> Index: linux-2.6/drivers/scsi/scsi_transport_spi.c
> ===================================================================
> --- linux-2.6.orig/drivers/scsi/scsi_transport_spi.c	2007-02-11 14:16:51.000000000 -0600
> +++ linux-2.6/drivers/scsi/scsi_transport_spi.c	2007-02-12 15:20:59.000000000 -0600
> @@ -787,6 +787,7 @@ spi_dv_device_internal(struct scsi_devic
>  	struct scsi_target *starget = sdev->sdev_target;
>  	struct Scsi_Host *shost = sdev->host;
>  	int len = sdev->inquiry_len;
> +
>  	/* first set us up for narrow async */
>  	DV_SET(offset, 0);
>  	DV_SET(width, 0);
> @@ -917,8 +918,25 @@ spi_dv_device(struct scsi_device *sdev)
>  	if (unlikely(scsi_device_get(sdev)))
>  		return;
>  
> -	if (unlikely(spi_dv_in_progress(starget)))
> +	if (unlikely(spi_dv_in_progress(starget))) {
> +		/*
> +		 * If DV is already pending, just make sure the device
> +		 * has all the parameters set (in case this is the
> +		 * result of a reset during the in progress DV)
> +		 */
> +		DV_SET(dt, spi_dt(starget));
> +		DV_SET(iu, spi_iu(starget));
> +		DV_SET(width, spi_width(starget));
> +		DV_SET(offset, spi_offset(starget));
> +		DV_SET(period, spi_period(starget));
> +		DV_SET(qas, spi_qas(starget));
> +		DV_SET(rd_strm, spi_rd_strm(starget));
> +		DV_SET(wr_flow, spi_wr_flow(starget));
> +		DV_SET(rti, spi_rti(starget));
> +		DV_SET(pcomp_en, spi_pcomp_en(starget));
> +		scsi_device_put(sdev);
>  		return;
> +	}
>  	spi_dv_in_progress(starget) = 1;
>  
>  	buffer = kzalloc(len, GFP_KERNEL);
> 
> 
-- 
Mark Haverkamp <markh@linux-foundation.org>


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

* Re: [PATCH] scsi spi transport: SCSI domain validation after reset
  2007-02-05 21:50 ` James Bottomley
@ 2007-02-05 22:01   ` Mark Haverkamp
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Haverkamp @ 2007-02-05 22:01 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Moore, Eric

On Mon, 2007-02-05 at 15:50 -0600, James Bottomley wrote:
> On Mon, 2007-02-05 at 12:49 -0800, Mark Haverkamp wrote:
> > James,
> > 
> > Some months ago, I had problems with a mis-behaving disk that failed
> > domain validation on a fusion card resulting in an infinite loop of
> > domain validation.  At the time Eric proposed a patch to the mptspi
> > driver to reload devices with parameters previously negotiated when a
> > reset occurred.  You indicated that a more generic solution should be
> > done.
> > 
> > This patch updates spi_dv_device_internal() to check if domain
> > validation has already been performed on a device and just sets it
> > previously negotiated parameters.  This solved the "infinite domain
> > validation" loop for me when a reset is performed as a result of command
> > timeout with the mis-behaving device.
> 
> Er,but this code basically disabled domain revalidation after a reset,
> doesn't it? 

Yes it does.  The problem I am seeing is that a device that fails
validation can cause a reset to occur.  If it does, then all devices are
now re-validated.  Including any that have failed validation previously.
Which can cause another reset and another validation, etc. forever.  I'm
not sure how else to break out of this cycle.

>  If we could do it that way, we could simply take the calls
> to spi_dv_device() out of the fusion driver and instead set the
> parameters up in its place without having to modify the transport class.

If I understand your comment, I believe that is what Eric proposed at
one point. But it seems other drivers/adapters could have a similar
problem.

Mark.



-- 
Mark Haverkamp <markh@linux-foundation.org>


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

* Re: [PATCH] scsi spi transport: SCSI domain validation after reset
  2007-02-05 20:49 Mark Haverkamp
@ 2007-02-05 21:50 ` James Bottomley
  2007-02-05 22:01   ` Mark Haverkamp
  0 siblings, 1 reply; 7+ messages in thread
From: James Bottomley @ 2007-02-05 21:50 UTC (permalink / raw)
  To: Mark Haverkamp; +Cc: linux-scsi, Moore, Eric

On Mon, 2007-02-05 at 12:49 -0800, Mark Haverkamp wrote:
> James,
> 
> Some months ago, I had problems with a mis-behaving disk that failed
> domain validation on a fusion card resulting in an infinite loop of
> domain validation.  At the time Eric proposed a patch to the mptspi
> driver to reload devices with parameters previously negotiated when a
> reset occurred.  You indicated that a more generic solution should be
> done.
> 
> This patch updates spi_dv_device_internal() to check if domain
> validation has already been performed on a device and just sets it
> previously negotiated parameters.  This solved the "infinite domain
> validation" loop for me when a reset is performed as a result of command
> timeout with the mis-behaving device.

Er,but this code basically disabled domain revalidation after a reset,
doesn't it?  If we could do it that way, we could simply take the calls
to spi_dv_device() out of the fusion driver and instead set the
parameters up in its place without having to modify the transport class.

James



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

* [PATCH] scsi spi transport: SCSI domain validation after reset
@ 2007-02-05 20:49 Mark Haverkamp
  2007-02-05 21:50 ` James Bottomley
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Haverkamp @ 2007-02-05 20:49 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, Moore, Eric

James,

Some months ago, I had problems with a mis-behaving disk that failed
domain validation on a fusion card resulting in an infinite loop of
domain validation.  At the time Eric proposed a patch to the mptspi
driver to reload devices with parameters previously negotiated when a
reset occurred.  You indicated that a more generic solution should be
done.

This patch updates spi_dv_device_internal() to check if domain
validation has already been performed on a device and just sets it
previously negotiated parameters.  This solved the "infinite domain
validation" loop for me when a reset is performed as a result of command
timeout with the mis-behaving device.

Signed-off-by Mark Haverkamp <markh@linux-foundation.org>

---

Applies to scsi-misc-2.6

---

Index: scsi-misc-2.6/drivers/scsi/scsi_transport_spi.c
===================================================================
--- scsi-misc-2.6.orig/drivers/scsi/scsi_transport_spi.c
+++ scsi-misc-2.6/drivers/scsi/scsi_transport_spi.c
@@ -363,6 +363,7 @@ static int child_iter(struct device *dev
 {
 	struct scsi_device *sdev = to_scsi_device(dev);
 
+	spi_initial_dv(sdev->sdev_target) = 0;
 	spi_dv_device(sdev);
 	return 1;
 }
@@ -787,6 +788,29 @@ spi_dv_device_internal(struct scsi_devic
 	struct scsi_target *starget = sdev->sdev_target;
 	struct Scsi_Host *shost = sdev->host;
 	int len = sdev->inquiry_len;
+
+	/*
+	 * If dv has been done already on this target, just set its
+         * previously determined parameters.
+         */
+	if (spi_initial_dv(starget)) {
+		DV_SET(dt, spi_dt(starget));
+		DV_SET(iu, spi_iu(starget));
+		DV_SET(width, spi_width(starget));
+		DV_SET(offset, spi_offset(starget));
+		DV_SET(period, spi_period(starget));
+		DV_SET(qas, spi_qas(starget));
+		DV_SET(rd_strm, spi_rd_strm(starget));
+		DV_SET(wr_flow, spi_wr_flow(starget));
+		DV_SET(rti, spi_rti(starget));
+		DV_SET(pcomp_en, spi_pcomp_en(starget));
+		if (spi_dv_device_compare_inquiry(sdev, buffer,
+		    buffer, DV_LOOPS) == SPI_COMPARE_SUCCESS)
+			return;
+		starget_printk(KERN_ERR, starget,
+				"Domain Validation Inquiry Failed\n");
+	}
+
 	/* first set us up for narrow async */
 	DV_SET(offset, 0);
 	DV_SET(width, 0);
@@ -917,8 +941,10 @@ spi_dv_device(struct scsi_device *sdev)
 	if (unlikely(scsi_device_get(sdev)))
 		return;
 
-	if (unlikely(spi_dv_in_progress(starget)))
+	if (unlikely(spi_dv_in_progress(starget))) {
+		scsi_device_put(sdev);
 		return;
+	}
 	spi_dv_in_progress(starget) = 1;
 
 	buffer = kzalloc(len, GFP_KERNEL);

-- 
Mark Haverkamp <markh@linux-foundation.org>


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

end of thread, other threads:[~2007-02-12 23:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-07 23:51 [PATCH] scsi spi transport: SCSI domain validation after reset Eric Moore
2007-02-12 16:14 ` Mark Haverkamp
2007-02-12 21:45   ` James Bottomley
2007-02-12 23:00     ` Mark Haverkamp
  -- strict thread matches above, loose matches on Subject: below --
2007-02-05 20:49 Mark Haverkamp
2007-02-05 21:50 ` James Bottomley
2007-02-05 22:01   ` Mark Haverkamp

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.