Skip to contentSkip to conversation

SCSI signal(I/O) failure causes no response

RFC PATCH In review Masao Fukuchi 2 participants 2 messages Apr 14, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 SCSI signal(I/O) failure causes no response

Hi all,

We are planning to use linux for enterprise server. Since the response time on hardware failure is important factor, we are measuring the response time in case of the error by making pseudo errors.

We generated some SCSI signal failure in the test.
When I cut the I/O signal during read command from host, I expected the command finished with error soon.
But the result was the command didn't finish forever(and no error message was displayed).

I added some messages in order to investigate what has occurred.

Quoted 1 line

From the messages, the sequence was:

1.Fusion MPT driver issues read command to its firmware.
(our server has LSI53C1030 as SCSI adapter)
Then the firmware returns protocol error for the command. Fusion MPT driver makes DID_RESET status by protocol error and sends it to SCSI midlayer.

2.SCSI midlayer analyzes the status from LLD.
SCSI midlayer schedules command retry because the status is just DID_RESET status.
(When the status has DID_RESET plus some sense code, the retry
sequence depends on the sense code. But when the status has only DID_RESET, SCSI midlayer schedules command retry)

Sequence 1. and 2. are repeated infinitely and it causes no response.

To prevent this problem, I proposed Eric Moore to change the DID_RESET status to DID_SOFT_ERROR in fusion MPT driver.
But he suggested me to change SCSI midlayer to prevent infinite loop.

So, I made following patch to prevent the problem. (patch is based on kernel 2.6.5)

Comments welcome.

Thanks,
Masao Fukuchi

///

drivers/scsi/scsi_lib.c +4 -2
diff -uarN linux-2.6.5/drivers/scsi/scsi_lib.c linux-didreset/drivers/scsi/scsi_lib.c
@@ -852,8 +852,10 @@
 		 * recovery reasons.  Just retry the request
 		 * and see what happens.  
 		 */
-		scsi_requeue_command(q, cmd);
-		return;
+		if (++cmd->retries < cmd->allowed) {
+			scsi_requeue_command(q, cmd);
+			return;
+		}
 	}
 	if (result) {
 		printk("SCSI error : <%d %d %d %d> return code = 0x%x\n",
#1 lore raw
Quoted 13 lines · Masao Fukuchi

1.Fusion MPT driver issues read command to its firmware.
(our server has LSI53C1030 as SCSI adapter)
Then the firmware returns protocol error for the command. Fusion MPT driver makes DID_RESET status by protocol error and sends it to SCSI midlayer.

2.SCSI midlayer analyzes the status from LLD.
SCSI midlayer schedules command retry because the status is just DID_RESET status.
(When the status has DID_RESET plus some sense code, the retry
sequence depends on the sense code. But when the status has only DID_RESET, SCSI midlayer schedules command retry)

Quoted 5 lines

Sequence 1. and 2. are repeated infinitely and it causes no response.

To prevent this problem, I proposed Eric Moore to change the DID_RESET status to DID_SOFT_ERROR in fusion MPT driver.
But he suggested me to change SCSI midlayer to prevent infinite loop.

Well, there clearly is a problem, because we can't retry no-rety commands that return DID_RESET (like tape commands or fastfail).

However, DID_RESET is supposed to be returned for events where it was determined that the command was lost because the bus or device was reset (either as part of error handling or because an external entity issued the reset). Since these events, if they originate externally, can be beyond the control of the device, making retryable commands subject to the retry limit would be asking for unnecessary I/O errors because of something we couldn't do anything about.

Why is the LSI driver returning DID_RESET for the problem (i.e. is it some type of external bus reset, or is something else going on)?

James