linux-mips
[Top] [All Lists]

[PATCH] cevt-r4k.c irq ack optimization

To: linux-mips@linux-mips.org
Subject: [PATCH] cevt-r4k.c irq ack optimization
From: Ricardo Mendoza <ricmm@gentoo.org>
Date: Tue, 5 Aug 2008 10:37:28 +0000
Cc: ralf@linux-mips.org, yoichi_yuasa@tripeaks.co.jp, ricmm@gentoo.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.16 (2007-06-09)
Hello Ralf,

Whereas current implementation works, the modification below can protect
us from problems such as the pipeline hazards in vr41xx cpus without any
added extra code length. Also, I beleive Yoichi posted something similar
a few months ago.

Please apply.


     Ricardo

---

Ack the IRQ by writing to c0_compare it's own value rather than the
c0_count value. This prevents issues caused by pipeline hazards, on
vr41xx for example.

Signed-off-by: Ricardo Mendoza <ricmm@gentoo.org>
---
 arch/mips/kernel/cevt-r4k.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 24a2d90..16e079c 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_count());
+               c0_timer_ack();
                irq_disable_hazard();
                if (c0_compare_int_pending())
                        return 0;
@@ -208,7 +208,7 @@ static int c0_compare_int_usable(void)
        if (!c0_compare_int_pending())
                return 0;
 
-       write_c0_compare(read_c0_count());
+       c0_timer_ack();
        irq_disable_hazard();
        if (c0_compare_int_pending())
                return 0;

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] cevt-r4k.c irq ack optimization, Ricardo Mendoza <=