Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack()
@ 2008-03-17 14:47 Yoichi Yuasa
  2008-03-17 14:49 ` [PATCH 2/2][MIPS] add irq_disable_hazard() before c0_compare_int_pending() Yoichi Yuasa
  2008-03-17 16:16 ` [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack() Ralf Baechle
  0 siblings, 2 replies; 6+ messages in thread
From: Yoichi Yuasa @ 2008-03-17 14:47 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: yoichi_yuasa, linux-mips

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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-03-19  7:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-17 14:47 [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack() Yoichi Yuasa
2008-03-17 14:49 ` [PATCH 2/2][MIPS] add irq_disable_hazard() before c0_compare_int_pending() Yoichi Yuasa
2008-03-17 16:16 ` [PATCH 1/2][MIPS] replace c0_compare acknowledge by c0_timer_ack() Ralf Baechle
2008-03-18  4:47   ` Yoichi Yuasa
2008-03-18 13:27     ` Ralf Baechle
2008-03-19  7:38       ` [PATCH][MIPS] add CP0 hazard to CP0 compare register accesses Yoichi Yuasa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox