Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a6c43a78763da67d4049745ce35122734e89fbc
Commit:     3a6c43a78763da67d4049745ce35122734e89fbc
Parent:     c637fecb4fe67e2baccef24b9b7e9cb79ee23cf8
Author:     Atsushi Nemoto <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 21:55:42 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 29 19:35:35 2007 +0000

    [MIPS] time: Make c0_compare_int_usable faster
    
    Try increasingly longer time periods starting of at 0x10 cycles.  This
    should be fast on hardware and work nicely with emulators.
    
    Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/cevt-r4k.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 7274fd2..a59f67f 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -179,7 +179,7 @@ static int c0_compare_int_pending(void)
 
 static int c0_compare_int_usable(void)
 {
-       const unsigned int delta = 0x300000;
+       unsigned int delta;
        unsigned int cnt;
 
        /*
@@ -192,9 +192,15 @@ static int c0_compare_int_usable(void)
                        return 0;
        }
 
-       cnt = read_c0_count();
-       cnt += delta;
-       write_c0_compare(cnt);
+       for (delta = 0x10; delta <= 0x400000; delta <<= 1) {
+               cnt = read_c0_count();
+               cnt += delta;
+               write_c0_compare(cnt);
+               irq_disable_hazard();
+               if ((int)(read_c0_count() - cnt) < 0)
+                   break;
+               /* increase delta if the timer was already expired */
+       }
 
        while ((int)(read_c0_count() - cnt) <= 0)
                ;       /* Wait for expiry  */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to