public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Pranav Prasad <pranavpp@google.com>
Cc: rafael@kernel.org, pavel@ucw.cz, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, krossmo@google.com,
	jstultz@google.com
Subject: Re: [PATCH] alarmtimer, PM: suspend: Expose a function from
Date: Wed, 07 Feb 2024 12:26:26 +0100	[thread overview]
Message-ID: <87msscms65.ffs@tglx> (raw)
In-Reply-To: <CAJZ5v0gXsCuVvqynDeuf_NZtyAJ07umx1NUqfFZb25vjNABAfw@mail.gmail.com>

On Wed, Jan 31 2024 at 21:10, Rafael J. Wysocki wrote:
> On Wed, Jan 31, 2024 at 8:13 PM Pranav Prasad <pranavpp@google.com> wrote:
>> @@ -564,6 +565,8 @@ static int enter_state(suspend_state_t state)
>>  #endif
>>         } else if (!valid_state(state)) {
>>                 return -EINVAL;
>> +       } else if (time_check_suspend_fail()) {
>> +               return -ETIME;
>
> This causes a function defined in modular code to be called from
> non-modular code which is an obvious mistake.
>
> It also makes the generic suspend code call a function defined in a
> random driver, which is a total no-go as far as I am concerned.

Alarmtimers is built-in core infrastructure and not a random modular
driver, but nevertheless:

> Why don't you instead define a PM notifier in the alarmtimer driver
> and check if it is going to trigger shortly from there?  PM notifiers
> run before the tasks freezer, so there would be a little difference
> timing-wise and you can return whatever error code you like from
> there.  As an additional benefit, you'd be able to handle hibernation
> in the same way.

Makes sense.

Thanks,

        tglx

  reply	other threads:[~2024-02-07 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 19:13 [PATCH] alarmtimer, PM: suspend: Expose a function from Pranav Prasad
2024-01-31 20:10 ` Rafael J. Wysocki
2024-02-07 11:26   ` Thomas Gleixner [this message]
2024-02-07 11:20 ` Thomas Gleixner

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=87msscms65.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=jstultz@google.com \
    --cc=krossmo@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=pranavpp@google.com \
    --cc=rafael@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