Received: from [140.186.70.92] (port=51359 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OFP4Q-0006fz-1F for qemu-devel@nongnu.org; Fri, 21 May 2010 06:03:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OFP2D-00013A-Cp for qemu-devel@nongnu.org; Fri, 21 May 2010 06:00:54 -0400 Received: from hall.aurel32.net ([88.191.82.174]:51602) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFP2D-000135-7n for qemu-devel@nongnu.org; Fri, 21 May 2010 06:00:53 -0400 Date: Fri, 21 May 2010 12:00:39 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH 1/2] arm_timer: reload timer when enabled Message-ID: <20100521100039.GC23891@volta.aurel32.net> References: <1272793852-26260-1-git-send-email-rabin@rab.in> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1272793852-26260-1-git-send-email-rabin@rab.in> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rabin Vincent Cc: qemu-devel@nongnu.org On Sun, May 02, 2010 at 03:20:51PM +0530, Rabin Vincent wrote: > Reload the timer when TimerControl is written, if the timer is to be > enabled. Otherwise, if an earlier write to TimerLoad was done while > periodic mode was not set, s->delta may incorrectly still have the value > of the maximum limit instead of the value written to TimerLoad. > > This problem is evident on versatileap on current linux-next, which > enables TIMER_CTRL_32BIT before writing to TimerLoad and then enabling > periodic mode and starting the timer. This causes the first periodic > tick to be scheduled to occur after 0xffffffff periods, leading to a > perceived hang while the kernel waits for the first timer tick. > > Signed-off-by: Rabin Vincent Thanks, applied. > --- > hw/arm_timer.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/hw/arm_timer.c b/hw/arm_timer.c > index 9fef191..5b6947a 100644 > --- a/hw/arm_timer.c > +++ b/hw/arm_timer.c > @@ -113,7 +113,7 @@ static void arm_timer_write(void *opaque, target_phys_addr_t offset, > case 1: freq >>= 4; break; > case 2: freq >>= 8; break; > } > - arm_timer_recalibrate(s, 0); > + arm_timer_recalibrate(s, s->control & TIMER_CTRL_ENABLE); > ptimer_set_freq(s->timer, freq); > if (s->control & TIMER_CTRL_ENABLE) { > /* Restart the timer if still enabled. */ > -- > 1.7.0.4 > > > > -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net