diff options
-rw-r--r-- | firmware/drivers/ata.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 1a8ff37cb7..101c9bd4e8 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -173,7 +173,6 @@ int ata_read_sectors(unsigned long start, | |||
173 | 173 | ||
174 | mutex_lock(&ata_mtx); | 174 | mutex_lock(&ata_mtx); |
175 | 175 | ||
176 | #ifndef USE_STANDBY | ||
177 | if ( sleeping ) { | 176 | if ( sleeping ) { |
178 | #ifdef USE_POWEROFF | 177 | #ifdef USE_POWEROFF |
179 | if (ata_power_on()) { | 178 | if (ata_power_on()) { |
@@ -181,14 +180,15 @@ int ata_read_sectors(unsigned long start, | |||
181 | return -1; | 180 | return -1; |
182 | } | 181 | } |
183 | #else | 182 | #else |
183 | #ifdef USE_SLEEP | ||
184 | if (perform_soft_reset()) { | 184 | if (perform_soft_reset()) { |
185 | mutex_unlock(&ata_mtx); | 185 | mutex_unlock(&ata_mtx); |
186 | return -1; | 186 | return -1; |
187 | } | 187 | } |
188 | #endif | 188 | #endif |
189 | #endif | ||
189 | sleeping = false; | 190 | sleeping = false; |
190 | } | 191 | } |
191 | #endif | ||
192 | 192 | ||
193 | if (!wait_for_rdy()) | 193 | if (!wait_for_rdy()) |
194 | { | 194 | { |
@@ -263,7 +263,6 @@ int ata_write_sectors(unsigned long start, | |||
263 | 263 | ||
264 | mutex_lock(&ata_mtx); | 264 | mutex_lock(&ata_mtx); |
265 | 265 | ||
266 | #ifndef USE_STANDBY | ||
267 | if ( sleeping ) { | 266 | if ( sleeping ) { |
268 | #ifdef USE_POWEROFF | 267 | #ifdef USE_POWEROFF |
269 | if (ata_power_on()) { | 268 | if (ata_power_on()) { |
@@ -271,14 +270,15 @@ int ata_write_sectors(unsigned long start, | |||
271 | return -1; | 270 | return -1; |
272 | } | 271 | } |
273 | #else | 272 | #else |
273 | #ifdef USE_SLEEP | ||
274 | if (perform_soft_reset()) { | 274 | if (perform_soft_reset()) { |
275 | mutex_unlock(&ata_mtx); | 275 | mutex_unlock(&ata_mtx); |
276 | return -1; | 276 | return -1; |
277 | } | 277 | } |
278 | #endif | 278 | #endif |
279 | #endif | ||
279 | sleeping = false; | 280 | sleeping = false; |
280 | } | 281 | } |
281 | #endif | ||
282 | 282 | ||
283 | if (!wait_for_rdy()) | 283 | if (!wait_for_rdy()) |
284 | { | 284 | { |
@@ -397,6 +397,7 @@ static int ata_perform_sleep(void) | |||
397 | mutex_lock(&ata_mtx); | 397 | mutex_lock(&ata_mtx); |
398 | 398 | ||
399 | if(!wait_for_rdy()) { | 399 | if(!wait_for_rdy()) { |
400 | DEBUGF("ata_perform_sleep() - not RDY\n"); | ||
400 | mutex_unlock(&ata_mtx); | 401 | mutex_unlock(&ata_mtx); |
401 | return -1; | 402 | return -1; |
402 | } | 403 | } |
@@ -412,7 +413,10 @@ static int ata_perform_sleep(void) | |||
412 | #endif | 413 | #endif |
413 | 414 | ||
414 | if (!wait_for_rdy()) | 415 | if (!wait_for_rdy()) |
416 | { | ||
417 | DEBUGF("ata_perform_sleep() - CMD failed\n"); | ||
415 | ret = -1; | 418 | ret = -1; |
419 | } | ||
416 | #endif | 420 | #endif |
417 | sleeping = true; | 421 | sleeping = true; |
418 | mutex_unlock(&ata_mtx); | 422 | mutex_unlock(&ata_mtx); |