On Thu, 17 Oct 2019 at 17:09, Philippe Mathieu-Daudé <phi...@redhat.com> 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