Linux Power Management development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Kevin Hilman <khilman@baylibre.com>,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH] PM / Domains: Propagate start and restore errors during runtime resume
Date: Thu, 03 Mar 2016 22:40:57 +0200	[thread overview]
Message-ID: <20238814.QZ2mBrvjzj@avalon> (raw)
In-Reply-To: <CAJZ5v0hL3ZF_bmyCePmM0RUsNpJF67NjFwLRUC5Y6Sjaf=evsw@mail.gmail.com>

Hi Rafael,

On Thursday 03 March 2016 21:34:04 Rafael J. Wysocki wrote:
> On Thu, Mar 3, 2016 at 9:32 PM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > On Thu, Mar 3, 2016 at 9:24 PM, Kevin Hilman <khilman@baylibre.com> wrote:
> >> Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> writes:
> >>> During runtime resume the return values of the start and restore steps
> >>> are ignored. As a result drivers are not notified of runtime resume
> >>> failures and can't propagate them up. Fix it by returning an error if
> >>> either the start or restore step fails, and clean up properly in the
> >>> error path.
> >>> 
> >>> Signed-off-by: Laurent Pinchart
> >>> <laurent.pinchart+renesas@ideasonboard.com>
> >>> ---
> >>> 
> >>>  drivers/base/power/domain.c | 20 ++++++++++++++++++--
> >>>  1 file changed, 18 insertions(+), 2 deletions(-)
> >>> 
> >>> This fixes an issue I've noticed with my driver's .runtime_resume()
> >>> handler returning an error that was never propagated out of
> >>> pm_runtime_get_sync().
> >> 
> >> Acked-by: Kevin Hilman <khilman@baylibre.com>
> >> 
> >>> A second issue then appeared. The device .runtime_error field is set to
> >>> the error code returned by my .runtime_resume() handler, but it never
> >>> reset. Any subsequent try to resume the device fails with -EINVAL. I'm
> >>> not sure what the right way to solve that is, advices are welcome.
> >> 
> >> Probably setting it (back) to zero after each successful runtime_suspend
> >> or runtime_resume is the right way.  Rafael?
> > 
> > That follows the assumption that runtime PM usually won't be reliable
> > after an error, so runtime_error has to be cleared explicitly via
> > pm_runtime_set_status().
> 
> Sorry, that won't work.
> 
> Anyway, the idea is that the error has to be cleared manually after a
> failure.

Thanks for the advice, I'll try doing so in my driver.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2016-03-03 20:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-01 23:20 [PATCH] PM / Domains: Propagate start and restore errors during runtime resume Laurent Pinchart
2016-03-03 20:24 ` Kevin Hilman
2016-03-03 20:32   ` Rafael J. Wysocki
2016-03-03 20:34     ` Rafael J. Wysocki
2016-03-03 20:40       ` Laurent Pinchart [this message]
2016-03-03 20:32   ` Laurent Pinchart
2016-03-04 10:22 ` Ulf Hansson
2016-03-04 20:38   ` Laurent Pinchart
2016-03-04 21:22     ` Rafael J. Wysocki

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=20238814.QZ2mBrvjzj@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=khilman@baylibre.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --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