qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/5] mc146818rtc: properly count the time for th


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/5] mc146818rtc: properly count the time for the next interrupt
Date: Thu, 4 May 2017 14:02:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0


On 04/05/2017 04:54, Xiao Guangrong wrote:
>>>
>>> +            /*
>>> +             * if more than period clocks were passed, i.e, the
>>> timer interrupt
>>> +             * has been lost, we should catch up the time.
>>> +             */
>>> +            if (s->lost_tick_policy == LOST_TICK_POLICY_SLEW &&
>>> +                (lost_clo / period)) {
>>> +                int lost_interrupt = lost_clock / period;
>>> +
>>> +                s->irq_coalesced += lost_interrupt;
>>> +                lost_clock -= lost_interrupt * period;
>>> +                if (lost_interrupt) {
>>> +                    DPRINTF_C("cmos: compensate %d interrupts,
>>> coalesced irqs "
>>> +                              "increased to %d\n", lost_interrupt,
>>> +                              s->irq_coalesced);
>>> +                    rtc_coalesced_timer_update(s);
>>> +                }
>>
>> I think you should merge these two patches, since both of them
>> essentially update the number of coalesced ticks and then split it
>> between s->irq_coalesced and lost_clock.
> 
> I thought these two patches fix two different issues, one for clock
> lost for coalesced-irq and another for period reconfiguration. Your
> suggestion sounds reasonable indeed, will merged them in the next
> version. :)

Yunfang's patch in turn has two parts, one that is only for SLEW and one
that is not.  You can keep the first separate, and merge the second with
yours.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]