diff options
| author | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-04-07 20:01:21 +0000 |
|---|---|---|
| committer | Torne Wuff <torne@wolfpuppy.org.uk> | 2010-04-07 20:01:21 +0000 |
| commit | 62321ed0bd7d8d5879a9caad3d8f642dbe876033 (patch) | |
| tree | e569e1e2ec72f7300ddf956831a21cef427cfc9b /firmware/drivers/ata.c | |
| parent | b3d44fcb57173b7995bf67a88aa24aa447f74f52 (diff) | |
| download | rockbox-62321ed0bd7d8d5879a9caad3d8f642dbe876033.zip rockbox-62321ed0bd7d8d5879a9caad3d8f642dbe876033.tar.gz rockbox-62321ed0bd7d8d5879a9caad3d8f642dbe876033.tar.bz2 rockbox-62321ed0bd7d8d5879a9caad3d8f642dbe876033.tar.xz | |
Make ATA code not bother to retry requests that return IDNF (specified sector not valid).
There's no point retrying these requests for five seconds, the sector number isn't going to get any more valid. It interferes with being able to detect broken drives like the 5.5G 80GB iPod's.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25525 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata.c')
| -rw-r--r-- | firmware/drivers/ata.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index ddbd6a1..2140456 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -478,6 +478,7 @@ static int ata_transfer_sectors(unsigned long start, int sectors; int wordcount; int status; + int error; if (!wait_for_start_of_transfer()) { /* We have timed out waiting for RDY and/or DRQ, possibly @@ -502,6 +503,7 @@ static int ata_transfer_sectors(unsigned long start, /* read the status register exactly once per loop */ status = ATA_STATUS; + error = ATA_ERROR; if (count >= multisectors ) sectors = multisectors; @@ -526,6 +528,9 @@ static int ata_transfer_sectors(unsigned long start, if ( status & (STATUS_BSY | STATUS_ERR | STATUS_DF) ) { perform_soft_reset(); ret = -6; + /* no point retrying IDNF, sector no. was invalid */ + if (error & ERROR_IDNF) + break; goto retry; } @@ -537,8 +542,14 @@ static int ata_transfer_sectors(unsigned long start, } if(!ret && !wait_for_end_of_transfer()) { + int error; + + error = ATA_ERROR; perform_soft_reset(); ret = -4; + /* no point retrying IDNF, sector no. was invalid */ + if (error & ERROR_IDNF) + break; goto retry; } break; |