Skip to contentSkip to conversation

2.4 SCSI error handling fixes

PATCH In review Russell King 1 participant 1 message Sep 12, 2002 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 2.4 SCSI error handling fixes

I've been chasing a few SCSI problems today, and here's 4 patches to address the issues I found. These patches are against 2.4.19.

My main aim here was to solve the bad behaviour with a medium error. Some problems were found in my HBA driver, but some were found in the error handling code.

Problems found were:

a) retrying a command with stale or invalid command information. (Patches 1 and 2)
b) reporting the wrong command on IO error.
(Patch 3)
c) drives behaving badly in error condition, reporting success without data transfer.
(Patch 4)

Results of investigation into these issues can be found at in my lkml messages at:

http://marc.theaimsgroup.com/?l=linux-kernel&m=103184937214222&w=2

Patch 4 is the one I'm least happy about; we shouldn't unconditionally set the FUA bit in READ10 commands. It seems that we need to set this bit only after receiving an error, and only when we try to read the remaining blocks which we believe are good.

Patch 3: when reporting an error, display the ultimate command, not the last command that was issued. This is important for HBA drivers that automatically send REQUEST SENSE to the drive; reporting that the command was REQUEST SENSE is nonsense.

drivers/scsi/scsi_lib.c +1 -1
@@ -750,7 +750,7 @@
 			printk("scsi%d: ERROR on channel %d, id %d, lun %d, CDB: ",
 			       SCpnt->host->host_no, (int) SCpnt->channel,
 			       (int) SCpnt->target, (int) SCpnt->lun);
-			print_command(SCpnt->cmnd);
+			print_command(SCpnt->data_cmnd);
 			print_sense("sd", SCpnt);
 			SCpnt = scsi_end_request(SCpnt, 0, block_sectors);
 			return;
Signature · 2 lines
Russell King ([email protected])                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html