patch-2.1.132 linux/drivers/scsi/scsi_obsolete.c

Next file: linux/drivers/sound/Config.in
Previous file: linux/drivers/scsi/scsi_error.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.131/linux/drivers/scsi/scsi_obsolete.c linux/drivers/scsi/scsi_obsolete.c
@@ -607,9 +607,7 @@
 	if ((++SCpnt->retries) < SCpnt->allowed)
 	{
 	    if ((SCpnt->retries >= (SCpnt->allowed >> 1))
-		/* FIXME: last_reset == 0 is allowed */
-                && time_after(jiffies, SCpnt->host->last_reset
-                              + MIN_RESET_PERIOD)
+		&& !(SCpnt->host->resetting && time_before(jiffies, SCpnt->host->last_reset + MIN_RESET_PERIOD))
 		&& !(SCpnt->flags & WAS_RESET))
 	    {
 		printk("scsi%d channel %d : resetting for second half of retries.\n",
@@ -617,7 +615,6 @@
 		scsi_reset(SCpnt, SCSI_RESET_SYNCHRONOUS);
 		break;
 	    }
-
 	}
 	else
 	{
@@ -935,6 +932,12 @@
                 }
 
 		host->last_reset = jiffies;
+		host->resetting = 1;
+		/*
+		 * I suppose that the host reset callback will not play
+		 * with the resetting field. We have just set the resetting
+		 * flag here. -arca
+		 */
 		temp = host->hostt->reset(SCpnt, reset_flags);
 		/*
 		  This test allows the driver to introduce an additional bus
@@ -953,7 +956,13 @@
 	    {
 		if (!host->block) host->host_busy++;
 		host->last_reset = jiffies;
-	        SCpnt->flags |= (WAS_RESET | IS_RESETTING);
+		host->resetting = 1;
+		SCpnt->flags |= (WAS_RESET | IS_RESETTING);
+		/*
+		 * I suppose that the host reset callback will not play
+		 * with the resetting field. We have just set the resetting
+		 * flag here. -arca
+		 */
 		temp = host->hostt->reset(SCpnt, reset_flags);
 		if (time_before(host->last_reset, jiffies) ||
 		    (time_after(host->last_reset, jiffies + 20 * HZ)))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov