|
| From: | Dmitry Osipenko |
| Subject: | Re: [Qemu-devel] [PATCH] arm_mptimer: Fix timer shutdown |
| Date: | Thu, 02 Jul 2015 15:10:05 +0300 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Hello Peter, thanks a lot for comment. 02.07.2015 12:27, Peter Maydell пишет:
Thanks; this does look like a bug. This change will mean we
call timer_del() even if the timer was already disabled,
though, so I think it would be slightly better to rearrange
the existing logic something like this:
if ((old & 1) != (value & 1)) {
if (value & 1) {
if (tb->count == 0 && (tb->control & 2)) {
tb->count = tb->load;
}
timerblock_reload(tb, 1);
} else {
timer_del(tb->timer);
}
}
thanks
-- PMM
Calling timer_del() twice is safe, but I agree that it would be better to avoid it. I'll send V2.
-- Dmitry
| [Prev in Thread] | Current Thread | [Next in Thread] |