From: Thomas Gleixner <tglx@linutronix.de>
To: "Lee, Zhuo-hao" <zhuo-hao.lee@intel.com>
Cc: John Stultz <john.stultz@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"zhuohao.lee82@gmail.com" <zhuohao.lee82@gmail.com>
Subject: RE: [PATCH v2] alarmtimer: fix unexpected rtc interrupt when system resume from S3
Date: Tue, 17 Nov 2015 11:06:47 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1511171036130.3761@nanos> (raw)
In-Reply-To: <12EF70CDEA59BA47AD9EC69F20130B3401AF1DFC@PGSMSX103.gar.corp.intel.com>
On Tue, 17 Nov 2015, Lee, Zhuo-hao wrote:
Can you please fix your e-mail client to do proper line breaks around
80 char?
> >> (1). alarmtimer create a rtc wake up timer however alarmtimer won't
> >> remove that timer if the system wake up earlier
>
> > That's hardly a bug. That's a slight incorrectness which needs to be fixed.
>
> I think this timer is useless after system resume. For the
> correctness, I think it should be fixed. Do you agree? Or do you
> have any other suggestions? :)
Care to read what I wrote?
> > ... That's a slight incorrectness which needs to be fixed.
> >> (2). rtc wake up timer will trigger hpet_rtc_interrupt continuously
> >> until timer timeout.
>
> >> This patch only fixed (1). Fixing (1) can avoid (2).
> >> However, The (2) is another story which it is not covered by this patch.
>
> > And that's the real interesting question. Why is hpet_rtc_interrupt
> > continously triggered?
> I think this is caused by driver implementation.
> My explanation for the continuous hpet_rtc_interrupt():
> 1. In hpet_rtc_timer_init(), it will set "delta" to 1/64 seconds in
> AIE mode (about 16ms, because of the value DEFAULT_RTC_SHIFT),
> that will cause hpet_rtc_interrupt() be triggered in every 16ms
> if the wakeup time (global variable hpet_alarm_time) is not
> reached.
>
> 2. When someone calls rtc_timer_start (ex: alarmtimer_suspend ),
> hpet driver will set timeout value (current time + delta) to
> hpet_alarm_time, and then enable hpet timer.
>
> 3. In hpet_rtc_interrupt(), it will call hpet_rtc_timer_reinit() to
> reinit timer and add "delta" to the hpet_t1_cmp for the next
> timeout value ( so we will receive an interrupt after 16ms).
>
> If hpet_alarm_time is reached, the irq_handler() will be called, the
> hpet_rtc_flags will be set to 0 and the hpet timer will be
> disable.
>
> Otherwise, we will receive an interrupt in each 16ms.
Right. We cannot do much about it. So the changelog of this patch
wants some explanation. Something like this:
This was noticed because the HPET RTC emulation fires an interrupt
every 16ms up to the point where the alarm time is reached.
Simply because you wouldn't have noticed if the interrupt happened
after 2 hours.
Thanks,
tglx
prev parent reply other threads:[~2015-11-17 10:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 5:50 zhuo-hao.lee
2015-11-09 2:26 ` Lee, Zhuo-hao
2015-11-13 20:32 ` John Stultz
2015-11-14 14:12 ` Lee, Zhuo-hao
2015-11-16 18:00 ` Thomas Gleixner
2015-11-17 7:02 ` Lee, Zhuo-hao
2015-11-17 10:06 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.11.1511171036130.3761@nanos \
--to=tglx@linutronix.de \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhuo-hao.lee@intel.com \
--cc=zhuohao.lee82@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®