* Understanding suspend() vs suspend_late() for I2c devices
@ 2017-09-19 17:35 Rajat Jain
2017-09-19 20:30 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Rajat Jain @ 2017-09-19 17:35 UTC (permalink / raw)
To: Wysocki, Rafael J, Rafael J. Wysocki, Len Brown, Pavel Machek,
linux-pm, linux-kernel, linux-i2c, Andy Shevchenko,
Jarkko Nikula, Mika Westerberg, Wolfram Sang, Furquan Shaikh,
Rajat Jain
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?
Thanks,
Rajat
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Understanding suspend() vs suspend_late() for I2c devices
2017-09-19 17:35 Understanding suspend() vs suspend_late() for I2c devices Rajat Jain
@ 2017-09-19 20:30 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2017-09-19 20:30 UTC (permalink / raw)
To: Rajat Jain
Cc: Wysocki, Rafael J, Len Brown, Pavel Machek, linux-pm,
linux-kernel, linux-i2c, Andy Shevchenko, Jarkko Nikula,
Mika Westerberg, Wolfram Sang, Furquan Shaikh, Rajat Jain
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-19 20:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 17:35 Understanding suspend() vs suspend_late() for I2c devices Rajat Jain
2017-09-19 20:30 ` Rafael J. Wysocki
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®