From: Kevin D. Kissell Date: Tue, 10 Nov 2009 19:45:46 +0000 (-0800) Subject: MIPS: SMTC: Fix lockup in smtc_distribute_timer X-Git-Tag: v2.6.32-rc8~36^2 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=5df9d11be46a9f704208644a1e7f13c6104ecff2;p=safe%2Fjmp%2Flinux-2.6 MIPS: SMTC: Fix lockup in smtc_distribute_timer 1. At the end of smtc_distribute_timer, nextstamp is valid and has already passed so we goto repeat. 2. Nothing updates nextstamp (only updated if the timeout is in the future And we just decided it is in the past) 3. At the end nextstamp still has the same value so it is still valid and in the past. 4. This repeats until read_c0_count has a value which causes nextstamp to be in the future. Reported and initial patch and testing by Mikael Starvik . Signed-off-by: Kevin D. Kissell Cc: Mikael Starvik Cc: linux-mips@linux-mips.org Cc: Jesper Nilsson Patchwork: http://patchwork.linux-mips.org/patch/621/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/cevt-smtc.c b/arch/mips/kernel/cevt-smtc.c index 98bd7de..b102e4f 100644 --- a/arch/mips/kernel/cevt-smtc.c +++ b/arch/mips/kernel/cevt-smtc.c @@ -173,11 +173,12 @@ void smtc_distribute_timer(int vpe) unsigned int mtflags; int cpu; struct clock_event_device *cd; - unsigned long nextstamp = 0L; + unsigned long nextstamp; unsigned long reference; repeat: + nextstamp = 0L; for_each_online_cpu(cpu) { /* * Find virtual CPUs within the current VPE who have