diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-11-09 18:57:47 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-11-09 18:57:47 +0000 |
commit | 412bea9782db6843bcefd53ce7ce74b003b3c8c5 (patch) | |
tree | 9c7e84f4c7f4b95ad0b8ac280cade008394281a9 /firmware/drivers/ata_mmc.c | |
parent | 0d941425b95d0b5fd55862a6f1f0c4fd1222db28 (diff) | |
download | rockbox-412bea9782db6843bcefd53ce7ce74b003b3c8c5.tar.gz rockbox-412bea9782db6843bcefd53ce7ce74b003b3c8c5.zip |
Ondio: Better activity monitoring for 'ata' idle notification.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11481 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ata_mmc.c')
-rw-r--r-- | firmware/drivers/ata_mmc.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index 9491429542..bf78bc84f4 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -981,7 +981,7 @@ void ata_spin(void) | |||
981 | static void mmc_thread(void) | 981 | static void mmc_thread(void) |
982 | { | 982 | { |
983 | struct event ev; | 983 | struct event ev; |
984 | static long last_seen_mtx_unlock = 0; | 984 | bool idle_notified = false; |
985 | 985 | ||
986 | while (1) { | 986 | while (1) { |
987 | queue_wait_w_tmo(&mmc_queue, &ev, HZ); | 987 | queue_wait_w_tmo(&mmc_queue, &ev, HZ); |
@@ -1006,14 +1006,16 @@ static void mmc_thread(void) | |||
1006 | #endif | 1006 | #endif |
1007 | 1007 | ||
1008 | default: | 1008 | default: |
1009 | if (!ata_disk_is_active()) | 1009 | if (TIME_BEFORE(current_tick, last_disk_activity+(3*HZ))) |
1010 | { | 1010 | { |
1011 | if (!last_seen_mtx_unlock) | 1011 | idle_notified = false; |
1012 | last_seen_mtx_unlock = current_tick; | 1012 | } |
1013 | if (TIME_AFTER(current_tick, last_seen_mtx_unlock+(HZ*10))) | 1013 | else |
1014 | { | ||
1015 | if (!idle_notified) | ||
1014 | { | 1016 | { |
1015 | call_ata_idle_notifys(false); | 1017 | call_ata_idle_notifys(false); |
1016 | last_seen_mtx_unlock = 0; | 1018 | idle_notified = true; |
1017 | } | 1019 | } |
1018 | } | 1020 | } |
1019 | break; | 1021 | break; |