Skip to contentSkip to conversation

libata-eh: Add a simple mechanism for silencing error reporting

PATCH In review Alan 3 participants 4 messages Feb 5, 2007 – Feb 23, 2007 libata

lore
Share & tools
lore

Alan

author
#0 lore raw

PATCH 1/1 libata-eh: Add a simple mechanism for silencing error reporting

We want to be able to issue commands that fail silently some of the time (set_features/xfer rate to CF 1.4 devices, perhaps some others such as user SG_IO commands ought to be silent too as the error is for the app)

This is a minimal implementation, we can extend it so the QUIET flag isn't quiet about errors that are not command errors but indicate infrastructre problems (CRC errors, HSM violation, DeviceFault) if need be.

drivers/ata/libata-eh.c +4 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/libata-eh.c linux-2.6.20-rc6-mm3/drivers/ata/libata-eh.c
@@ -1407,6 +1407,8 @@
 			continue;
 		if (qc->flags & ATA_QCFLAG_SENSE_VALID && !qc->err_mask)
 			continue;
+		if (qc->tf.flags & ATA_TFLAG_QUIET)
+			continue;
 
 		nr_failed++;
 	}
@@ -1446,6 +1448,8 @@
 
 		if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
 			continue;
+		if (qc->tf.flags & ATA_TFLAG_QUIET)
+			continue;
 
 		ata_dev_printk(qc->dev, KERN_ERR,
 			"cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "
include/linux/ata.h +1 -0
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/include/linux/ata.h linux-2.6.20-rc6-mm3/include/linux/ata.h
@@ -232,6 +232,7 @@
 	ATA_TFLAG_LBA		= (1 << 4), /* enable LBA */
 	ATA_TFLAG_FUA		= (1 << 5), /* enable FUA */
 	ATA_TFLAG_POLLING	= (1 << 6), /* set nIEN to 1 and use polling */
+	ATA_TFLAG_QUIET		= (1 << 7), /* don't log rejection */
 };
 
 enum ata_tf_protocols {
#1 lore raw
Quoted 24 lines · Alan

We want to be able to issue commands that fail silently some of the time (set_features/xfer rate to CF 1.4 devices, perhaps some others such as user SG_IO commands ought to be silent too as the error is for the app)

This is a minimal implementation, we can extend it so the QUIET flag isn't quiet about errors that are not command errors but indicate infrastructre problems (CRC errors, HSM violation, DeviceFault) if need be.

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/libata-eh.c linux-2.6.20-rc6-mm3/drivers/ata/libata-eh.c

drivers/ata/libata-eh.c +2 -0
@@ -1407,6 +1407,8 @@
 			continue;
 		if (qc->flags & ATA_QCFLAG_SENSE_VALID && !qc->err_mask)
 			continue;
+		if (qc->tf.flags & ATA_TFLAG_QUIET)
+			continue;
 
 		nr_failed++;
 	}

drivers/ata/libata-eh.c line 1455

Quoted 8 lines
drivers/ata/libata-eh.c +2 -0
@@ -1446,6 +1448,8 @@
 
 		if (!(qc->flags & ATA_QCFLAG_FAILED) || !qc->err_mask)
 			continue;
+		if (qc->tf.flags & ATA_TFLAG_QUIET)
+			continue;
 
 		ata_dev_printk(qc->dev, KERN_ERR,
 			"cmd %02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x "

I think the result can be a bit confusing if ehc->i.err_mask is set (port/dev exception message without failed command report). How about counting nr_quiet and doing if (nr_failed == nr_quiet) return right after the counting block?

Signature · 1 line
tejun
#2 lore raw
In reply to Alan
Quoted 15 lines · Alan

We want to be able to issue commands that fail silently some of the time (set_features/xfer rate to CF 1.4 devices, perhaps some others such as user SG_IO commands ought to be silent too as the error is for the app)

This is a minimal implementation, we can extend it so the QUIET flag isn't quiet about errors that are not command errors but indicate infrastructre problems (CRC errors, HSM violation, DeviceFault) if need be.

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.20-rc6-mm3/drivers/ata/libata-eh.c linux-2.6.20-rc6-mm3/drivers/ata/libata-eh.c

drivers/ata/libata-eh.c line 1414

Quoted 8 lines
drivers/ata/libata-eh.c +2 -0
@@ -1407,6 +1407,8 @@
 			continue;
 		if (qc->flags & ATA_QCFLAG_SENSE_VALID && !qc->err_mask)
 			continue;
+		if (qc->tf.flags & ATA_TFLAG_QUIET)
+			continue;
 
 		nr_failed++;
 	}

I would rather pass an ok-to-fail-without-recovery type flag to EH. This TFLAG_QUIET approach is poorly defined, probably temporary, and not really interesting for upstream

Jeff

author
#3 lore raw
Quoted 3 lines

I would rather pass an ok-to-fail-without-recovery type flag to EH. This TFLAG_QUIET approach is poorly defined, probably temporary, and not really interesting for upstream

Fail without recovery flags make sense, but then we also need to ensure it is a fail without recovery messages. We could add qc->ignore_mask to mirror qc->err_mask ?

Alan