| To: | Ralf Baechle <ralf@linux-mips.org> |
|---|---|
| Subject: | [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack() |
| From: | Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> |
| Date: | Mon, 17 Mar 2008 23:47:40 +0900 |
| Cc: | yoichi_yuasa@tripeaks.co.jp, linux-mips <linux-mips@linux-mips.org> |
| Organization: | TriPeaks Corporation |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
VR41xx, CP0 hazard is necessary between read_c0_count() and write_c0_compare().
However, the problem can be solved by replacing this by c0_timer_ack().
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/kernel/cevt-r4k.c
linux/arch/mips/kernel/cevt-r4k.c
--- linux-orig/arch/mips/kernel/cevt-r4k.c 2008-03-11 10:10:09.453835304
+0900
+++ linux/arch/mips/kernel/cevt-r4k.c 2008-03-12 16:35:42.911447048 +0900
@@ -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;
@@ -198,7 +198,7 @@ static int c0_compare_int_usable(void)
write_c0_compare(cnt);
irq_disable_hazard();
if ((int)(read_c0_count() - cnt) < 0)
- break;
+ break;
/* increase delta if the timer was already expired */
}
@@ -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> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2/2][MIPS] add irq_disable_hazard() before c0_compare_int_pending(), Yoichi Yuasa |
|---|---|
| Next by Date: | Re: [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack(), Ralf Baechle |
| Previous by Thread: | unexpected irq 71 on ip32, Giuseppe Sacco |
| Next by Thread: | [PATCH 2/2][MIPS] add irq_disable_hazard() before c0_compare_int_pending(), Yoichi Yuasa |
| Indexes: | [Date] [Thread] [Top] [All Lists] |