mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: John Stultz <john.stultz@linaro.org>
Cc: zhuo-hao.lee@intel.com, lkml <linux-kernel@vger.kernel.org>,
	zhuohao.lee82@gmail.com
Subject: Re: [PATCH v3] alarmtimer: fix unexpected rtc interrupt when system resume from S3
Date: Wed, 25 Nov 2015 15:25:56 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1511251524310.12555@nanos> (raw)
In-Reply-To: <CALAqxLVAQ=S5G_WhNu3yDAEhpEVg2rN+G0gNSckz6goiy5nOPw@mail.gmail.com>

On Fri, 20 Nov 2015, John Stultz wrote:

> On Tue, Nov 17, 2015 at 4:08 AM,  <zhuo-hao.lee@intel.com> wrote:
> > From: zhuo-hao <zhuo-hao.lee@intel.com>
> >
> > Before the system go to suspend (S3), if user create a timer with clockid
> > CLOCK_REALTIME_ALARM/CLOCK_BOOTTIME_ALARM and set a "large" timeout value
> > to this timer. The function alarmtimer_suspend will be called to setup
> > a timeout value to RTC timer to avoid the system sleep over time. However,
> > if the system wakeup early than RTC timeout, the RTC timer will not be cleared.
> > And this will cause the hpet_rtc_interrupt come unexpectedly until the RTC
> > timeout. To fix this problem, just adding alarmtimer_resume to cancel the
> > RTC timer.
> >
> > This was noticed because the HPET RTC emulation fires an interrupt every
> > 16ms(=1/2^DEFAULT_RTC_SHIFT) up to the point where the alarm time is reached.
> > This program always hits this situation(https://lkml.org/lkml/2015/11/8/326),
> > if system wake up earlier than alarm time.
> 
> So thanks for the extra context here, and again I don't have an
> objection to this patch.
> 
> Although from the earlier discussion it still isn't quite clear to me:
> Why must the HPET RTC emulation need to fire the alarm every 16ms? Is
> that not something that can be fixed?

We probably can fix it with some surgery. OTOH that stuff is fragile
as hell and I rather avoid touching it, but I won't hinder someone
brave enough doing it :)
 
> I just want to make sure we're not hiding a deeper issue.

It's not a deeper issue. It's a - admittedly dumb - implementation
detail.

Thanks,

	tglx

  parent reply	other threads:[~2015-11-25 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 12:08 zhuo-hao.lee
2015-11-20 19:29 ` John Stultz
2015-11-23  1:57   ` Lee, Zhuo-hao
2015-11-25 14:25   ` Thomas Gleixner [this message]
2015-11-25 21:47     ` John Stultz

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.1511251524310.12555@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®