Subject: Re: Mode stepping in ATA
To: Charles M. Hannum <abuse@spamalicious.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 08/07/2001 23:31:16
--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii

On Thu, Aug 02, 2001 at 10:17:11PM +0000, Charles M. Hannum wrote:
> 
> Is there *ever* any reason to downgrade the mode for *any* reason
> other than a UDMA `transfer error'?  Under what condition would, say,
> an `uncorrectable data error' or `id not found' be resolved by
> downgrading?

Who knows with IDE :)

> 
> As far as I can tell, all this does is cause a surface analysis test
> to take approximately 6 times as long on my machine, because it steps
> all the way down from UDMA mode 4 to PIO mode 4 as it encounters bad
> spots.

I though I had fixed this a long time ago. Could you tell me if the attached
patch solves your problem ?

> 
> This has also bitten me in a different form with CD-R drives -- I'll
> accidentally try to read a blank disc or something, and it will
> immediately downgrade modes.  I have to reboot to get it back.

I don't know how to fix this one. for ATAPI devices ata_dmaerr() (which
performs the downgrade under some conditions) is only called for ATAPI
protocol errors. In this case the CD-R should return a check condition status.
It works properly with the CD and CD-R I have at work.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--

--vkogqOf2sHV7VnPd
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

--- ata_wdc.c.old	Tue Aug  7 23:11:02 2001
+++ ata_wdc.c	Tue Aug  7 23:30:54 2001
@@ -499,7 +499,10 @@
 		}
 		if (drv_err != WDC_ATA_ERR)
 			goto end;
-		ata_dmaerr(drvp);
+		if (ata_bio->error != ERROR ||
+		    ((ata_bio->r_error & WDCE_CRC) &&
+		     (drvp->drive_flags & DRIVE_UDMA)))
+			ata_dmaerr(drvp);
 	}
 
 	/* if we had an error, end */

--vkogqOf2sHV7VnPd--