mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: "dbasehore ." <dbasehore@chromium.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	Len Brown <len.brown@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v5 2/5] tick: Add freeze timer events
Date: Sat, 15 Jul 2017 14:39:09 +0200	[thread overview]
Message-ID: <7467728.lI8lN4PjS8@aspire.rjw.lan> (raw)
In-Reply-To: <CAGAzgsoFugSw=UQsJmep0woGg70J3nie0-EtvtQ4Ec1NG1usOg@mail.gmail.com>

On Thursday, July 13, 2017 03:58:53 PM dbasehore . wrote:
> On Thu, Jul 13, 2017 at 8:09 AM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Thu, Jul 13, 2017 at 9:32 AM, Peter Zijlstra <peterz@infradead.org> wrote:
> >> On Fri, Jul 07, 2017 at 05:03:00PM -0700, Derek Basehore wrote:
> >>> Adds a new feature to tick to schedule wakeups on a CPU during freeze.
> >>> This won't fully wake up the system (devices are not resumed), but
> >>> allow simple platform functionality to be run during freeze with
> >>> little power impact.
> >>>
> >>> This implementation allows an idle driver to setup a timer event with
> >>> the clock event device when entering freeze by calling
> >>> tick_set_freeze_event. Only one caller should exist for the function.
> >>>
> >>> tick_freeze_event_expired is used to check if the timer went off when
> >>> the CPU wakes.
> >>>
> >>> The event is cleared by tick_clear_freeze_event.
> >>
> >> Why? What's wrong with using the RTC stuff? RTC should be able to wake
> >> suspended systems, see RTCWAKE(8).
> >
> > The RTC interrupt is an SCI (on ACPI systems) and we don't handle it
> > at this point, so we don't know what woke us up until we re-enable
> > interrupt handlers and run the one for the SCI.
> 
> To add to that point, RTC wake ups are valid for fully waking up the
> system. The clock event wake up wasn't used for waking up the system
> before, so we know that we don't have to check if it should wake up
> the system entirely. The way rtc timers work right now, I think that
> we'd have to go all the way through resume devices to figure out if we
> should resume to user space or freeze again.

Actually, that's not exactly the case any more.

After some changes that went in for 4.13-rc1 there is an additional decision
point in the resume path, after the noirq stage, where we can decide to go back
to sleep if that's the right thing to do.

This means that in principle you might hack the CMOS RTC driver to do something
more sophisticated than just calling pm_wakeup_hard_event() in rtc_handler().

That's ACPI-specific, but I think you have ACPI on all of the systems where the
residency counders are going to be checked anyway.

Thanks,
Rafael

  reply	other threads:[~2017-07-15 12:46 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08  0:02 [PATCH v5 1/5] x86: stub out pmc function Derek Basehore
2017-07-08  0:03 ` [PATCH v5 2/5] tick: Add freeze timer events Derek Basehore
2017-07-08 16:05   ` Andy Shevchenko
2017-07-10 21:11     ` dbasehore .
2017-07-10 12:53   ` Rafael J. Wysocki
2017-07-12 21:25   ` Thomas Gleixner
2017-07-13  1:18     ` dbasehore .
2017-07-13  4:54       ` Thomas Gleixner
2017-07-13  7:32   ` Peter Zijlstra
2017-07-13 15:09     ` Rafael J. Wysocki
2017-07-13 22:58       ` dbasehore .
2017-07-15 12:39         ` Rafael J. Wysocki [this message]
2017-07-18  0:30           ` dbasehore .
2017-07-18  1:33             ` Rafael J. Wysocki
2017-07-18  3:52               ` dbasehore .
2017-07-18  6:40                 ` Thomas Gleixner
2017-07-18 20:09                   ` dbasehore .
2017-07-18 21:53                     ` Thomas Gleixner
2017-07-18 22:03                       ` dbasehore .
2017-07-18 22:22                         ` Thomas Gleixner
2017-07-18 22:37                           ` dbasehore .
2017-07-18 22:39                             ` Thomas Gleixner
2017-07-08  0:03 ` [PATCH v5 3/5] x86, apic: Add freeze event support Derek Basehore
2017-07-13  5:13   ` Thomas Gleixner
2017-07-08  0:03 ` [PATCH v5 4/5] freeze: Add error reporting Derek Basehore
2017-07-08  0:03 ` [PATCH v5 5/5] intel_idle: Add S0ix validation Derek Basehore
2017-07-09  7:13   ` kbuild test robot
2017-07-10 13:33   ` Rafael J. Wysocki
2017-07-10 21:57     ` dbasehore .
2017-07-10 22:09       ` Rafael J. Wysocki
2017-07-10 22:24         ` dbasehore .
2017-07-11 14:57           ` Rafael J. Wysocki
2017-07-11 15:43             ` Len Brown
2017-07-12 22:16   ` Thomas Gleixner
2017-07-12 23:14     ` dbasehore .
2017-07-13  5:11       ` Thomas Gleixner
2017-07-13 22:49         ` dbasehore .
2017-07-13  1:06     ` dbasehore .
2017-07-08 16:00 ` [PATCH v5 1/5] x86: stub out pmc function Andy Shevchenko

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=7467728.lI8lN4PjS8@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=dbasehore@chromium.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rajneesh.bhardwaj@intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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®