diff options
Diffstat (limited to 'firmware/drivers/ata.c')
-rw-r--r-- | firmware/drivers/ata.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 00ef0e8eb5..249cb3934e 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include "power.h" | 29 | #include "power.h" |
30 | #include "string.h" | 30 | #include "string.h" |
31 | #include "hwcompat.h" | 31 | #include "hwcompat.h" |
32 | 32 | #include "ata_idle_notify.h" | |
33 | #ifdef TARGET_TREE | 33 | #ifdef TARGET_TREE |
34 | #include "ata-target.h" | 34 | #include "ata-target.h" |
35 | #endif | 35 | #endif |
@@ -1364,6 +1364,7 @@ static void ata_thread(void) | |||
1364 | { | 1364 | { |
1365 | static long last_sleep = 0; | 1365 | static long last_sleep = 0; |
1366 | struct event ev; | 1366 | struct event ev; |
1367 | static long last_callback_run = 0; | ||
1367 | 1368 | ||
1368 | while (1) { | 1369 | while (1) { |
1369 | while ( queue_empty( &ata_queue ) ) { | 1370 | while ( queue_empty( &ata_queue ) ) { |
@@ -1373,8 +1374,16 @@ static void ata_thread(void) | |||
1373 | TIME_AFTER( current_tick, | 1374 | TIME_AFTER( current_tick, |
1374 | last_disk_activity + sleep_timeout ) ) | 1375 | last_disk_activity + sleep_timeout ) ) |
1375 | { | 1376 | { |
1376 | ata_perform_sleep(); | 1377 | if (!call_ata_idle_notifys()) |
1377 | last_sleep = current_tick; | 1378 | { |
1379 | ata_perform_sleep(); | ||
1380 | last_sleep = current_tick; | ||
1381 | } | ||
1382 | } | ||
1383 | else if (TIME_AFTER(current_tick, last_callback_run+(HZ*5))) | ||
1384 | { | ||
1385 | last_callback_run = current_tick; | ||
1386 | call_ata_idle_notifys(); | ||
1378 | } | 1387 | } |
1379 | 1388 | ||
1380 | #ifdef HAVE_ATA_POWER_OFF | 1389 | #ifdef HAVE_ATA_POWER_OFF |