Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: SGI-IP22: Retry the third timer calibration sample on zero
@ 2026-11-28 15:44 Imre Kaloz
  0 siblings, 0 replies; only message in thread
From: Imre Kaloz @ 2026-11-28 15:44 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

The third calibration sample can be 0 and is then averaged in, which
sets the Count rate to two thirds of its real value. Loop until it
is non-zero, as for the first two.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Imre Kaloz <kaloz@kernel.org>
---
 arch/mips/sgi-ip22/ip22-time.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 045aa89f28d8..e911bc03f1dd 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -93,7 +93,9 @@ __init void plat_time_init(void)
 
 	if (r4k_ticks[0] != r4k_ticks[1]) {
 		printk("warning: timer counts differ, retrying... ");
-		r4k_ticks[2] = dosample();
+		do {
+			r4k_ticks[2] = dosample();
+		} while (!r4k_ticks[2]);
 		if (r4k_ticks[2] == r4k_ticks[0]
 		    || r4k_ticks[2] == r4k_ticks[1])
 			r4k_tick = r4k_ticks[2];

base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
-- 
2.47.3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-28 15:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-28 15:44 [PATCH] MIPS: SGI-IP22: Retry the third timer calibration sample on zero Imre Kaloz

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