qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 5/8] hw/timer/altera_timer.c: Switch to transaction-based pti


From: Peter Maydell
Subject: Re: [PATCH 5/8] hw/timer/altera_timer.c: Switch to transaction-based ptimer API
Date: Thu, 17 Oct 2019 17:10:40 +0100

On Thu, 17 Oct 2019 at 17:09, Philippe Mathieu-Daudé <address@hidden> wrote:
>
> On 10/17/19 3:29 PM, Peter Maydell wrote:
> > -    t->bh = qemu_bh_new(timer_hit, t);
> > -    t->ptimer = ptimer_init_with_bh(t->bh, PTIMER_POLICY_DEFAULT);
> > +    t->ptimer = ptimer_init(timer_hit, t, PTIMER_POLICY_DEFAULT);
> > +    ptimer_transaction_begin(t->ptimer);
> >       ptimer_set_freq(t->ptimer, t->freq_hz);
> > +    ptimer_transaction_commit(t->ptimer);
>
> This looks odd because timers are not running at this point (REALIZE),
> but if we don't protect it, ptimer_set_freq() will trigger the assertion.

Yep. The same pattern is used in several of the other ptimer
users where a fixed frequency or period is set immediately after
init.

thanks
-- PMM



reply via email to

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