Revert "mc146818rtc: fix timer interrupt reinjection"

This reverts commit b429de7301, except
that the reversal of the outer "if (period)" is left in.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2019-11-17 10:07:38 +01:00
parent 0d074bf8e7
commit 3ae32adff1

View file

@ -174,7 +174,6 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period)
int64_t cur_clock, next_irq_clock, lost_clock = 0;
period = rtc_periodic_clock_ticks(s);
if (!period) {
s->irq_coalesced = 0;
timer_del(s->periodic_timer);
@ -197,6 +196,7 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period)
last_periodic_clock = next_periodic_clock - old_period;
lost_clock = cur_clock - last_periodic_clock;
assert(lost_clock >= 0);
}
/*
* s->irq_coalesced can change for two reasons:
@ -233,7 +233,6 @@ periodic_timer_update(RTCState *s, int64_t current_time, uint32_t old_period)
*/
lost_clock = MIN(lost_clock, period);
}
}
assert(lost_clock >= 0 && lost_clock <= period);