mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Saravana Kannan <saravanak@google.com>
Subject: Re: [RFC/RFT PATCH] PM: sleep: Ignore device driver suspend() callback return values
Date: Thu, 5 Dec 2024 12:54:02 -0500	[thread overview]
Message-ID: <ef8b9ca2-8b23-4ecb-9c41-01412475976f@rowland.harvard.edu> (raw)
In-Reply-To: <CAJvTdKm-7LbbeRkLpTDW5WBLR9vVNzjNhYWeRvM+Y4myCHN6uQ@mail.gmail.com>

On Thu, Dec 05, 2024 at 12:24:29PM -0500, Len Brown wrote:
> On Thu, Dec 5, 2024 at 10:09 AM Alan Stern <stern@rowland.harvard.edu> wrote:
> 
> > > IMV, drivers returning errors from their suspend callbacks without a
> > > sufficiently serious reason are kind of a problem.
> >
> > There is a least one driver whose suspend callback returns an error if
> > the device is enabled for wakeup and a wakeup event occurs during the
> > suspend procedure.  We don't want to ignore those races.
> 
> That driver should invoke pm_system_wakeup() on that wakeup event, right?

Should it?  When the system isn't yet suspended?  Is this documented 
anywhere?

There's still a race.  Suppose a wakeup-enabled device signals an 
interrupt and the interrupt handler runs just before the suspend-resume 
transition begins.  The handler might end up calling pm_system_wakeup() 
before the suspend starts, which won't accomplish anything, while the 
work queue that takes care of the device's events might get frozen (as 
part of the suspend transition) before it handles the new request.  As a 
result, the wakeup event will remain in limbo, not aborting the suspend, 
not causing an immediate resume, and not getting handled until something 
else wakes up the system.

Alan Stern

      reply	other threads:[~2024-12-05 17:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14  3:23 Len Brown
2024-12-05 11:55 ` Rafael J. Wysocki
2024-12-05 15:09   ` Alan Stern
2024-12-05 15:33     ` Ulf Hansson
2024-12-05 17:36       ` Len Brown
2024-12-05 17:57         ` Florian Fainelli
2024-12-05 20:57           ` Saravana Kannan
2024-12-05 17:24     ` Len Brown
2024-12-05 17:54       ` Alan Stern [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=ef8b9ca2-8b23-4ecb-9c41-01412475976f@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=saravanak@google.com \
    --cc=ulf.hansson@linaro.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®