[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH v2] hw/ptimer: Don't wrap around counter for expir

From: Peter Maydell
Subject: Re: [Qemu-arm] [PATCH v2] hw/ptimer: Don't wrap around counter for expired timer that uses tick handler
Date: Fri, 1 Jul 2016 17:36:00 +0100

On 30 June 2016 at 20:01, Dmitry Osipenko <address@hidden> wrote:
> On 30.06.2016 18:02, Peter Maydell wrote:
>> What I meant was: ptimer_get_count() is typically called to generate
>> a value to return from a register. That's a separate thing, conceptually,
>> from whether the device happens to also trigger an interrupt on timer
>> expiry by passing a bh to ptimer_init(). So it's very odd for a detail
>> of interrupt-on-timer-expiry (that there is a bottom half) to affect
>> the value returned when you read the timer count register.

> In order to handle wraparound correctly, software needs to track the moment of
> the wraparound - the interrupt. If software reads wrapped around counter value
> before IRQ triggered (ptimer expired), then it would assume that no wraparound
> happened and won't perform counter value correction, resulting in periodic
> counter "jumping" backwards.

That just says you need particular behaviour between counter reads
and IRQ triggers; it doesn't say that you need the behaviour to be
different if the ptimer code doesn't know about the IRQ trigger.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]