[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when time
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH] Fix interval interrupt of cadence ttc when timer is in decrement mode |
Date: |
Tue, 30 Jun 2015 10:38:19 -0700 |
On Tue, Jun 30, 2015 at 4:58 AM, Johannes Schlatow
<address@hidden> wrote:
> The interval interrupt is not set if the timer is in decrement mode.
> This is because x >=0 and x < interval after leaving the while-loop.
>
> Signed-off-by: Johannes Schlatow <address@hidden>
Reviewed-by: Peter Crosthwaite <address@hidden>
Can this go via target-arm for 2.4 (as a bugfix)?
Regards,
Peter
> ---
> hw/timer/cadence_ttc.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/hw/timer/cadence_ttc.c b/hw/timer/cadence_ttc.c
> index d46db3c..35bc880 100644
> --- a/hw/timer/cadence_ttc.c
> +++ b/hw/timer/cadence_ttc.c
> @@ -208,15 +208,14 @@ static void cadence_timer_sync(CadenceTimerState *s)
> s->reg_intr |= (2 << i);
> }
> }
> + if ((x < 0) || (x >= interval)) {
> + s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
> + COUNTER_INTR_IV : COUNTER_INTR_OV;
> + }
> while (x < 0) {
> x += interval;
> }
> s->reg_value = (uint32_t)(x % interval);
> -
> - if (s->reg_value != x) {
> - s->reg_intr |= (s->reg_count & COUNTER_CTRL_INT) ?
> - COUNTER_INTR_IV : COUNTER_INTR_OV;
> - }
> cadence_timer_update(s);
> }
>
> --
> 2.4.5
>
>