From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Rajat Jain <rajatja@google.com>
Cc: "Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-i2c@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Wolfram Sang <wsa@the-dreams.de>,
Furquan Shaikh <furquan@google.com>,
Rajat Jain <rajatxjain@gmail.com>
Subject: Re: Understanding suspend() vs suspend_late() for I2c devices
Date: Tue, 19 Sep 2017 22:30:37 +0200 [thread overview]
Message-ID: <30144911.QDmLjpI35A@aspire.rjw.lan> (raw)
In-Reply-To: <CACK8Z6EF+cHAh=7HQ2Z14wyRFTxRODYFZ-iV_MDp5=AqW=vNFw@mail.gmail.com>
On Tuesday, September 19, 2017 7:35:18 PM CEST Rajat Jain wrote:
> Hello folks,
>
> I'm trying to understand the valid expectations from i2c drivers
> standpoint, from suspend() callback vs suspend_late() callback. The
> Documentation/power/devices.txt states that:
>
> ==================================================
> For a number of devices it is convenient to split suspend into the
> "quiesce device" and "save device state" phases, in which cases
> suspend_late is meant to do the latter.
> ==================================================
>
> 1) So it seems that it is fair expectation from a driver, to be able
> to access its own device and its registers in
> suspend_late()/resume_early() call backs?
>
> 2) For the drivers that provide a controller to a bus (e.g.
> i2c_adapter drivers), is it correct that they should make sure that
> bus operation continues to stay OK even after their suspend() callback
> is executed?(This is because the drivers for the downstream devices -
> eg i2c_client drivers may want to talk to their device in *their*
> suspend_late() callbacks). So bus operations should be suspended by
> the adapter drivers only in their suspend_late() callback routines,
> and not suspend() routines?
Basically, yes, although there seems to be quite a bit of confusion around
that in i2c.
Generally speaking, a parent (or a supplier) device can only be fully
suspended if all of its child (or consumer) devices already have been
fully suspended.
Accordingly, it is better to suspend all of the bus controllers in the
"late suspend" phase and resume them in the "early resume" one. Then, the
dependent devices can be suspended either in the "suspend" or in the
"late suspend" phase and the PM core should get the dependencies right
(and analogously for resume).
Thanks,
Rafael
prev parent reply other threads:[~2017-09-19 20:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 17:35 Rajat Jain
2017-09-19 20:30 ` Rafael J. Wysocki [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=30144911.QDmLjpI35A@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=andriy.shevchenko@linux.intel.com \
--cc=furquan@google.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=len.brown@intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=pavel@ucw.cz \
--cc=rafael.j.wysocki@intel.com \
--cc=rajatja@google.com \
--cc=rajatxjain@gmail.com \
--cc=wsa@the-dreams.de \
/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®