diff options
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/ata.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index e65200eea2..c2a02cb03c 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -191,6 +191,9 @@ int ata_read_sectors(unsigned long start, | |||
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | timeout = current_tick + READ_TIMEOUT; | ||
195 | |||
196 | retry: | ||
194 | ATA_SELECT = ata_device; | 197 | ATA_SELECT = ata_device; |
195 | if (!wait_for_rdy()) | 198 | if (!wait_for_rdy()) |
196 | { | 199 | { |
@@ -198,9 +201,6 @@ int ata_read_sectors(unsigned long start, | |||
198 | return -2; | 201 | return -2; |
199 | } | 202 | } |
200 | 203 | ||
201 | timeout = current_tick + READ_TIMEOUT; | ||
202 | |||
203 | retry: | ||
204 | buf = inbuf; | 204 | buf = inbuf; |
205 | count = incount; | 205 | count = incount; |
206 | while (TIME_BEFORE(current_tick, timeout)) { | 206 | while (TIME_BEFORE(current_tick, timeout)) { |
@@ -228,6 +228,8 @@ int ata_read_sectors(unsigned long start, | |||
228 | 228 | ||
229 | if ( ATA_ALT_STATUS & (STATUS_ERR | STATUS_DF) ) { | 229 | if ( ATA_ALT_STATUS & (STATUS_ERR | STATUS_DF) ) { |
230 | ret = -5; | 230 | ret = -5; |
231 | if (perform_soft_reset()) | ||
232 | break; | ||
231 | goto retry; | 233 | goto retry; |
232 | } | 234 | } |
233 | 235 | ||