From: Thomas Gleixner <tglx@linutronix.de>
To: John Stultz <jstultz@google.com>
Cc: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>,
LKML <linux-kernel@vger.kernel.org>,
Stephen Boyd <sboyd@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Michael <michael@mipisi.de>,
kernel-team@android.com, Peter Zijlstra <peterz@infradead.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [RFC][PATCH 2/2] time: alarmtimer: Use TASK_FREEZABLE to cleanup freezer handling
Date: Wed, 01 Mar 2023 23:11:50 +0100 [thread overview]
Message-ID: <87h6v4ktp5.ffs@tglx> (raw)
In-Reply-To: <CANDhNCq8_Ly9SOwwxrsRCtATotnxpcmkS+5GCnkFVWOWtXfwKQ@mail.gmail.com>
On Mon, Feb 27 2023 at 20:06, John Stultz wrote:
> On Mon, Feb 27, 2023 at 4:03 PM John Stultz <jstultz@google.com> wrote:
>> > On Mon, Feb 20 2023 at 19:11, Michael Nazzareno Trimarchi wrote:
>> > +static int alarmtimer_pm_notifier_fn(struct notifier_block *bl, unsigned long state,
>> > + void *unused)
>> > +{
>> > + switch (state) {
>> > + case PM_HIBERNATION_PREPARE:
>> > + case PM_POST_HIBERNATION:
>> > + atomic_set(&alarmtimer_wakeup, 0);
>> > + break;
>> > + }
>> > + return NOTIFY_DONE;
>>
>> But here, we're setting the alarmtimer_wakeup count to zero if we get
>> PM_HIBERNATION_PREPARE or PM_POST_HIBERNATION notifications?
>> And Michael noted we need to add PM_SUSPEND_PREPARE and
>> PM_POST_SUSPEND there for this to seemingly work.
Yup. I missed those when sending out that hack.
> So Thomas's notifier method of zeroing at the begining of suspend and
> tracking any wakeups after that point makes more sense now. It still
> feels a bit messy, but I'm not sure there's something better.
I'm not enthused about it either.
> My only thought is this feels a little bit like its mirroring what the
> pm_wakeup_event() logic is supposed to do. Should we be adding a
> pm_wakeup_event() to alarmtimer_fired() to try to prevent suspend from
> occuring for 500ms or so after an alarmtimer has fired so there is
> enough time for it to be re-armed if needed?
The question is whether this can be called unconditionally and how that
interacts with the suspend logic. Rafael?
Thanks,
tglx
next prev parent reply other threads:[~2023-03-01 22:11 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-11 6:45 [RFC][PATCH 1/2] time: alarmtimer: Fix erroneous case of using 0 as an "invalid" initialization value John Stultz
2023-02-11 6:45 ` [RFC][PATCH 2/2] time: alarmtimer: Use TASK_FREEZABLE to cleanup freezer handling John Stultz
2023-02-15 8:22 ` Michael Nazzareno Trimarchi
2023-02-15 13:52 ` Thomas Gleixner
2023-02-18 14:56 ` Michael Nazzareno Trimarchi
2023-02-20 7:23 ` Thomas Gleixner
2023-02-20 8:23 ` Michael Nazzareno Trimarchi
2023-02-20 11:47 ` Michael Nazzareno Trimarchi
2023-02-20 17:48 ` Thomas Gleixner
2023-02-20 18:11 ` Michael Nazzareno Trimarchi
2023-02-20 21:18 ` Thomas Gleixner
2023-02-20 21:32 ` Michael Nazzareno Trimarchi
2023-02-21 0:12 ` Thomas Gleixner
2023-02-21 7:10 ` Michael Nazzareno Trimarchi
2023-02-24 10:02 ` Michael Nazzareno Trimarchi
2023-02-24 10:32 ` Michael Nazzareno Trimarchi
2023-02-24 11:57 ` Michael Nazzareno Trimarchi
2023-02-28 0:03 ` John Stultz
2023-02-28 4:06 ` John Stultz
2023-03-01 22:11 ` Thomas Gleixner [this message]
2023-03-02 0:47 ` John Stultz
2023-03-02 9:34 ` Michael Nazzareno Trimarchi
2023-03-02 15:00 ` Rafael J. Wysocki
2023-03-15 20:12 ` Michael Nazzareno Trimarchi
2023-03-02 14:54 ` Rafael J. Wysocki
2023-03-02 14:56 ` Rafael J. Wysocki
2023-03-02 14:32 ` Rafael J. Wysocki
2023-03-02 22:21 ` Thomas Gleixner
2023-03-02 22:58 ` Thomas Gleixner
2024-06-27 7:46 ` Michael Nazzareno Trimarchi
2024-07-13 10:47 ` Thomas Gleixner
2024-07-15 8:20 ` Michael Nazzareno Trimarchi
2023-02-21 11:50 ` Michael Nazzareno Trimarchi
2024-01-11 8:28 ` Michael Nazzareno Trimarchi
2023-02-18 14:51 ` [RFC][PATCH 1/2] time: alarmtimer: Fix erroneous case of using 0 as an "invalid" initialization value Michael Nazzareno Trimarchi
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=87h6v4ktp5.ffs@tglx \
--to=tglx@linutronix.de \
--cc=arnd@arndb.de \
--cc=jstultz@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@amarulasolutions.com \
--cc=michael@mipisi.de \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=sboyd@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