All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: Andrew Jeffery <andrew@aj.id.au>, openbmc@lists.ozlabs.org
Subject: Re: [RFC qemu legoater/aspeed-3.1 2/4] timer: aspeed: Status register contains reload for stopped timer
Date: Fri, 11 Jan 2019 10:58:19 +0100	[thread overview]
Message-ID: <ec1c3721-9c7c-c026-47fe-1ea1b30e2319@kaod.org> (raw)
In-Reply-To: <20190111035638.19725-3-andrew@aj.id.au>

On 1/11/19 4:56 AM, Andrew Jeffery wrote:
> From the datasheet:
> 
>> This register stores the current status of counter #N. When timer
>> enable bit TMC30[N * b] is disabled, the reload register will be
>> loaded into this counter. When timer bit TMC30[N * b] is set, the
>> counter will start to decrement. CPU can update this register value
>> when enable bit is set.
> 
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>  hw/timer/aspeed_timer.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c
> index 54c75bf4f322..6adc14d62034 100644
> --- a/hw/timer/aspeed_timer.c
> +++ b/hw/timer/aspeed_timer.c
> @@ -182,7 +182,11 @@ static uint64_t aspeed_timer_get_value(AspeedTimer *t, int reg)
>  
>      switch (reg) {
>      case TIMER_REG_STATUS:
> -        value = calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
> +        if (timer_enabled(t)) {
> +            value = calculate_ticks(t, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
> +        } else {
> +            value = t->reload;
> +        }
>          break;
>      case TIMER_REG_RELOAD:
>          value = t->reload;
> 

  reply	other threads:[~2019-01-11 10:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11  3:56 [RFC qemu legoater/aspeed-3.1 0/4] Handle short timer periods Andrew Jeffery
2019-01-11  3:56 ` [RFC qemu legoater/aspeed-3.1 1/4] timer: aspeed: Fire interrupt on failure to meet deadline Andrew Jeffery
2019-01-11  8:44   ` Cédric Le Goater
2019-01-11  8:52     ` Andrew Jeffery
2019-01-11  3:56 ` [RFC qemu legoater/aspeed-3.1 2/4] timer: aspeed: Status register contains reload for stopped timer Andrew Jeffery
2019-01-11  9:58   ` Cédric Le Goater [this message]
2019-01-11  3:56 ` [RFC qemu legoater/aspeed-3.1 3/4] timer: aspeed: Fix match calculations Andrew Jeffery
2019-01-11 10:00   ` Cédric Le Goater
2019-01-11  3:56 ` [RFC qemu legoater/aspeed-3.1 4/4] timer: aspeed: Provide back-pressure information for short periods Andrew Jeffery
2019-01-11 10:10   ` Cédric Le Goater
2019-01-13 23:07     ` Andrew Jeffery
2019-01-14  8:55       ` Cédric Le Goater
2019-01-11 10:14 ` [RFC qemu legoater/aspeed-3.1 0/4] Handle short timer periods Cédric Le Goater
2019-01-14  1:43   ` Andrew Jeffery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec1c3721-9c7c-c026-47fe-1ea1b30e2319@kaod.org \
    --to=clg@kaod.org \
    --cc=andrew@aj.id.au \
    --cc=openbmc@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.