[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled
From: |
Alex Bligh |
Subject: |
Re: [Qemu-devel] [PATCH] Don't enable a HPET timer if HPET is disabled |
Date: |
Sat, 22 Feb 2014 12:25:01 +0000 |
Paolo,
On 22 Feb 2014, at 10:55, Paolo Bonzini wrote:
> Il 22/02/2014 10:03, Alex Bligh ha scritto:
>> I am unfamiliar with the HPET code but symmetry suggests perhaps the 'else'
>> condition should be changed too:
>>
>> } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE) ||
>> !hpet_enabled(s)) {
>> hpet_del_timer(timer);
>> }
>>
>> --
>
> I thought the same, but there is no need for that. When the enabled bit goes
> from set to clear, all timers are disabled:
>
> } else if (deactivating_bit(old_val, new_val, HPET_CFG_ENABLE)) {
> /* Halt main counter and disable interrupt generation. */
> s->hpet_counter = hpet_get_ticks(s);
> for (i = 0; i < s->num_timers; i++) {
> hpet_del_timer(&s->timer[i]);
> }
> }
>
> So hpet_del_timer would be a nop if !hpet_enabled(s).
Thanks. I didn't know whether HPET_CFG_ENABLE and HPET_TN_ENABLE were
equivalent.
--
Alex Bligh