linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libata: Add a horkage entry for DRQ mishandling (atapi tapes)
@ 2007-09-20 14:27 Alan Cox
  2007-09-20 21:04 ` Jeff Garzik
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-09-20 14:27 UTC (permalink / raw)
  To: akpm, jeff, linux-ide

This will allow us to handle the tape drive problems Mark Lord reported

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.23rc6-mm1/include/linux/libata.h linux-2.6.23rc6-mm1/include/linux/libata.h
--- linux.vanilla-2.6.23rc6-mm1/include/linux/libata.h	2007-09-18 15:33:00.000000000 +0100
+++ linux-2.6.23rc6-mm1/include/linux/libata.h	2007-09-19 21:27:34.959820184 +0100
@@ -316,6 +316,7 @@
 	ATA_HORKAGE_MAX_SEC_128	= (1 << 3),	/* Limit max sects to 128 */
 	ATA_HORKAGE_BROKEN_HPA	= (1 << 4),	/* Broken HPA */
 	ATA_HORKAGE_HPA_SIZE	= (1 << 5), 	/* Reports native size off by one */
+	ATA_HORKAGE_DRQ		= (1 << 6),	/* Device forgets to clear DRQ on error */
 
 	/* DMA mask for user DMA control: User visible values do not
 	   renumber */
diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.vanilla-2.6.23rc6-mm1/drivers/ata/libata-core.c linux-2.6.23rc6-mm1/drivers/ata/libata-core.c
--- linux.vanilla-2.6.23rc6-mm1/drivers/ata/libata-core.c	2007-09-18 15:32:51.000000000 +0100
+++ linux-2.6.23rc6-mm1/drivers/ata/libata-core.c	2007-09-19 21:49:11.808669192 +0100
@@ -5099,8 +5151,13 @@
 		if (unlikely(status & (ATA_ERR | ATA_DF))) {
 			ata_port_printk(ap, KERN_WARNING, "DRQ=1 with device "
 					"error, dev_stat 0x%X\n", status);
-			qc->err_mask |= AC_ERR_HSM;
-			ap->hsm_task_state = HSM_ST_ERR;
+
+			/* Some tape drives muck this up so don't explode
+			   in those cases */
+			if (!(qc->dev->horkage & ATA_HORKAGE_DRQ)) {
+				qc->err_mask |= AC_ERR_HSM;
+				ap->hsm_task_state = HSM_ST_ERR;
+			}
 			goto fsm_start;
 		}
 

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

end of thread, other threads:[~2007-09-22  0:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20 14:27 [PATCH] libata: Add a horkage entry for DRQ mishandling (atapi tapes) Alan Cox
2007-09-20 21:04 ` Jeff Garzik
2007-09-20 21:42   ` Alan Cox
2007-09-22  0:33     ` Mark Lord

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).