From: Brian Norris <briannorris@chromium.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Ajay Agarwal <ajayagarwal@google.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
"jic23@kernel.org" <jic23@kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: PM runtime_error handling missing in many drivers?
Date: Fri, 21 Feb 2025 17:51:36 -0800 [thread overview]
Message-ID: <Z7ktqHxIhp90jLxi@google.com> (raw)
In-Reply-To: <50de9721-2dd8-448b-8c11-50b3923450f6@suse.com>
Hi Oliver,
On Thu, Feb 20, 2025 at 10:30:34AM +0100, Oliver Neukum wrote:
> On 19.02.25 23:15, Brian Norris wrote:
> > On Wed, Feb 12, 2025 at 08:29:34PM +0100, Rafael J. Wysocki wrote:
> > > The reason why runtime_error is there is to prevent runtime PM
> > > callbacks from being run until something is done about the error,
> > > under the assumption that running them in that case may make the
> > > problem worse.
> >
> > What makes you think it will make the problem worse? That seems like a
> > rather large assumption to me. What kind of things do you think go
> > wrong, that it requires the framework to stop any future attempts? Just
> > spam (e.g., logging noise, if -EIO is persistent)? Or something worse?e
>
> suspend() is three operations, potentially
>
> a) record device state
> b) arm remote wakeup
> c) transition to a lower power state
>
> I wouldn't trust a device to perform the first two steps
> without error handling either. It is an unnecessary risk.
I'm not sure I fully understand what you're saying. I'm not saying
drivers shouldn't handle errors. I'm just saying I don't see why the
framework should decide, "fail once and you're out."
Do you think (a) or (b) will fail silently if retried after a failed
operation? And what's the consequence?
> > But anyway, I don't think I require asymmetry; I'm just more interested
> > in unnecessary non-functionality. (Power inefficiency is less important,
> > as in the worst case, we can at least save our data, reboot, and try
> > again.)
>
> You are calling for asymmetry ;-)
Actually, you were the one who proposed asymmetry :) My concern is
asymmetric, but the solution doesn't have to be. For example, we could
remove runtime_error entirely, or else make it some kind of
ratelimited/backoff state.
Anyway, I appreciate that Rafael has helped improve the situation a bit
([PATCH v1] PM: runtime: Unify error handling during suspend and
resume). At least it gives us a tool to achieve what we want: ensure
that retriable failures produce -EBUSY or -EAGAIN. I'll have to give it
a whirl.
But I'm still wary that there are corner cases where other errors may
appear, and yet retrying is indeed the best option. And I'm not
confident that foisting the burden back onto the driver ("just scatter
pm_runtime_set_suspended() any time you might have fixed something") is
a practical approach either.
> If you fail to resume, you will need to return an error. The functions
> are just not equal in terms of consequences. We don't resume for fun.
> We do, however, suspend just because a timer fires.
Agreed.
Brian
prev parent reply other threads:[~2025-02-22 1:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 14:42 PM runtime_error handling missing in many drivers? Vincent Whitchurch
2022-06-21 9:38 ` Oliver Neukum
2022-07-08 11:03 ` Vincent Whitchurch
2022-07-08 20:10 ` Rafael J. Wysocki
2022-07-26 9:05 ` Oliver Neukum
2022-07-26 15:41 ` Rafael J. Wysocki
2022-07-27 8:08 ` Oliver Neukum
2022-07-27 16:31 ` Rafael J. Wysocki
2025-02-10 3:32 ` Ajay Agarwal
2025-02-11 22:21 ` Brian Norris
2025-02-12 19:29 ` Rafael J. Wysocki
2025-02-17 3:49 ` Ajay Agarwal
2025-02-17 20:23 ` Rafael J. Wysocki
2025-02-18 5:37 ` Ajay Agarwal
2025-02-18 5:45 ` Ajay Agarwal
2025-02-18 14:57 ` Rafael J. Wysocki
2025-02-19 22:15 ` Brian Norris
2025-02-20 9:30 ` Oliver Neukum
2025-02-22 1:51 ` Brian Norris [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=Z7ktqHxIhp90jLxi@google.com \
--to=briannorris@chromium.org \
--cc=ajayagarwal@google.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=oneukum@suse.com \
--cc=rafael.j.wysocki@intel.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