linux-mips
[Top] [All Lists]

[PATCH] Make c0_compare_int_usable more bullet proof

To: linux-mips@linux-mips.org
Subject: [PATCH] Make c0_compare_int_usable more bullet proof
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Tue, 23 Oct 2007 01:14:06 +0900 (JST)
Cc: ralf@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Use write_c0_compare(read_c0_count()) to clear interrupt.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index a915e56..ae2984f 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -186,7 +186,7 @@ static int c0_compare_int_usable(void)
         * IP7 already pending?  Try to clear it by acking the timer.
         */
        if (c0_compare_int_pending()) {
-               write_c0_compare(read_c0_compare());
+               write_c0_compare(read_c0_count());
                irq_disable_hazard();
                if (c0_compare_int_pending())
                        return 0;
@@ -202,7 +202,7 @@ static int c0_compare_int_usable(void)
        if (!c0_compare_int_pending())
                return 0;
 
-       write_c0_compare(read_c0_compare());
+       write_c0_compare(read_c0_count());
        irq_disable_hazard();
        if (c0_compare_int_pending())
                return 0;

<Prev in Thread] Current Thread [Next in Thread>