Linux IIO development
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Vincent Whitchurch <vincent.whitchurch@axis.com>,
	Oliver Neukum <oneukum@suse.com>
Cc: "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: Tue, 26 Jul 2022 11:05:32 +0200	[thread overview]
Message-ID: <1937b65c-36c0-5475-c745-d7285d1a6e25@suse.com> (raw)
In-Reply-To: <4ca77763-53d0-965a-889e-be2eafadfd2f@intel.com>



On 08.07.22 22:10, Rafael J. Wysocki wrote:
> On 7/8/2022 1:03 PM, Vincent Whitchurch wrote:

>> Perhaps Rafael can shed some light on this.
> 
> The driver always knows more than the framework about the device's
> actual state.  The framework only knows that something failed, but it
> doesn't know what it was and what way it failed.

Hi,

thinking long and deeply about this I do not think that this seemingly
obvious assertion is actually correct.

> The idea was that drivers would clear these errors.

I am afraid that is a deeply hidden layering violation. Yes, a driver's
resume() method may have failed. In that case, if that is the same
driver, it will obviously already know about the failure.

PM operations, however, are operating on a tree. A driver requesting
a resume may get an error code. But it has no idea where this error
comes from. The generic code knows at least that.

Let's look at at a USB storage device. The request to resume comes
from sd.c. sd.c is certainly not equipped to handle a PCI error
condition that has prevented a USB host controller from resuming.

I am afraid this part of the API has issues. And they keep growing
the more we divorce the device driver from the bus driver, which
actually does the PM operation.

	Regards
		Oliver


  reply	other threads:[~2022-07-26  9:05 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 [this message]
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

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=1937b65c-36c0-5475-c745-d7285d1a6e25@suse.com \
    --to=oneukum@suse.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=vincent.whitchurch@axis.com \
    /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