All of lore.kernel.org
 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

* Re: [PATCH] libata: Add a horkage entry for DRQ mishandling (atapi tapes)
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2007-09-20 21:04 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-ide, Mark Lord, Albert Lee

Alan Cox wrote:
> This will allow us to handle the tape drive problems Mark Lord reported
> 
> Signed-off-by: Alan Cox <alan@redhat.com>

According to information I have received, some ATA (and possibly ATAPI?) 
devices intentionally return some data in these cases.  In the case of 
certain ATA devices, this returned data permits inspection of the 
incorrected data.

I dunno about ATAPI devices, but it sounds like returning data here may 
be an unspecified but known behavior.

As such, it sounds like this warrants some core changes and not simply 
as a horkage bit?

	Jeff



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

* Re: [PATCH] libata: Add a horkage entry for DRQ mishandling (atapi tapes)
  2007-09-20 21:04 ` Jeff Garzik
@ 2007-09-20 21:42   ` Alan Cox
  2007-09-22  0:33     ` Mark Lord
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Cox @ 2007-09-20 21:42 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, linux-ide, Mark Lord, Albert Lee

> According to information I have received, some ATA (and possibly ATAPI?) 
> devices intentionally return some data in these cases.  In the case of 
> certain ATA devices, this returned data permits inspection of the 
> incorrected data.

News to me. ATA like ST-506/ST-412 exposes error data on I/O READ/WRITE
via the READ_BUFFER functionality but its basically useless without a lot
of knowledge of the drive on anything post ST-412 era.

Got any references ?

The other possibility is to whine but accept it happens - on the other
hand being lax about HSM errors is asking for corruption and it seems
to be unique to this tape device.

(and someone please don't tell me early pre ATAPI standard devices are
trying to return the sense data in this way or I'll be ill)

Alan

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

* Re: [PATCH] libata: Add a horkage entry for DRQ mishandling (atapi tapes)
  2007-09-20 21:42   ` Alan Cox
@ 2007-09-22  0:33     ` Mark Lord
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Lord @ 2007-09-22  0:33 UTC (permalink / raw)
  To: Alan Cox; +Cc: Jeff Garzik, akpm, linux-ide, Albert Lee

Alan Cox wrote:
>..
> The other possibility is to whine but accept it happens - on the other
> hand being lax about HSM errors is asking for corruption and it seems
> to be unique to this tape device.

s/this tape device/several tape devices/

Or possibly even "all" tape devices.

Cheers

^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.