linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux PCI <linux-pci@vger.kernel.org>,
	linux-usb@vger.kernel.org, Kevin Hilman <khilman@linaro.org>
Subject: Re: [PATCH v2] PM / Sleep: Add pm_generic functions to re-use runtime PM callbacks
Date: Wed, 27 Nov 2013 10:59:57 +0100	[thread overview]
Message-ID: <CAPDyKFow3Y7bWAWNxQyrKeHizk0TSoCuPLHD=p_1D=CAYQpm9A@mail.gmail.com> (raw)
In-Reply-To: <3028580.oiUVTDjyao@vostro.rjw.lan>

>>
>> There are already a generic callbacks that does this. Normally the
>> generic callbacks is used from buses and power domains.
>>
>> My new callbacks are intended to be used from the driver, so those are
>> kind of different from the others in that sense.
>
> Hmm.  I see.
>
> For that to work, the subsystem's .suspend() and .resume() callbacks will
> have to be implemented in a special way, because of the unknown runtime PM
> status of devices while those callbacks are being executed.

Not sure I understand why you think the runtime PM status is unknown?

In .suspend the runtime status can still be changed. Since the PM core
disables runtime PM before invoking .suspend_late and since the PM
core will keep runtime PM disabled until after the .resume_early has
been invoked, it will be safe to operate on the runtime PM callbacks
during this period - if the driver/bus are adopted for it. While the
.resume callback gets invoked, the runtime status are restored to it's
previous state, which the bus/driver would expect.

Do you want me to send a patch for a driver that uses these callbacks?
I suppose it would clarify how I am thinking...

>
> Presumably you think about subsystems that don't implement those callbacks
> at all?

If you mean that "drivers" is not a part of the term "subsystem" here,
then I somewhat agree.

My view is that it will be mostly drivers that make use of these callbacks.

Though, I don't think we need to prevent subsystems or power domains
from using them, they will only have to know what the consequences
are. :-)

Maybe there could even be some cases were it actually makes good sense
of using them for subsystems, even if I yet not have come a cross such
a case.

Kind regards
Ulf Hansson

>
> Rafael
>

  reply	other threads:[~2013-11-27  9:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 12:40 [PATCH v2] PM / Sleep: Add pm_generic functions to re-use runtime PM callbacks Ulf Hansson
2013-11-25 23:10 ` Rafael J. Wysocki
2013-11-26  9:48   ` Ulf Hansson
2013-11-26 20:34     ` Rafael J. Wysocki
2013-11-26 21:09       ` Alan Stern
2013-11-26 23:44         ` Ulf Hansson
2013-11-27  0:53           ` Rafael J. Wysocki
2013-11-27  9:59             ` Ulf Hansson [this message]
2013-11-27 14:12               ` Rafael J. Wysocki
2013-11-27 16:05                 ` Ulf Hansson
2013-11-27 16:06                   ` Ulf Hansson
2013-11-27  0:37         ` 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='CAPDyKFow3Y7bWAWNxQyrKeHizk0TSoCuPLHD=p_1D=CAYQpm9A@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).