[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
- Re: [PATCH 3/8] hw/timer/lm32_timer: Switch to transaction-based ptimer API, (continued)
- [PATCH 1/8] hw/timer/puv3_ost.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17
- [PATCH 4/8] hw/watchdog/milkymist-sysctl.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17
- [PATCH 5/8] hw/timer/altera_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17
- [PATCH 6/8] hw/watchdog/etraxfs_timer.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17
- [PATCH 8/8] hw/m68k/mcf5208.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17
- [PATCH 7/8] hw/m68k/mcf5206.c: Switch to transaction-based ptimer API, Peter Maydell, 2019/10/17