Re: [RFC] Power Management Infrastructure


Rahamim, Hezi
 

Hi Alex,

Please see my comments below.

Thank you for the inputs,
Hezi

From: D'alton, Alexandre
Sent: Tuesday, July 12, 2016 17:31
To: Rahamim, Hezi <hezi.rahamim(a)intel.com>; devel(a)lists.zephyrproject.org
Cc: Kidron, Amihai <amihai.kidron(a)intel.com>; Siman-tov, Keren <keren.siman-tov(a)intel.com>
Subject: RE: [RFC] Power Management Infrastructure

Hi Hezi,

Is there a specific need of being able to retrieve the current state of a device ?
It would only make sense if the device were able to change state by itself, which as far as I can tell is not the case.
Currently, the devices are slaves of the PM policy implementation and execute the state transitions accordingly.

[HR] We intend to give the user application the ability to set the state of the device according to its need.
The power manager service will then be called using the _sys_soc_suspend hook.
The power manager service will try to see if there is option to change the system state or to optimize the clock/power domain for the current devices states.

For the clock gating options, each drivers should transparently manage their clock gating in order to ensure an efficient power consumption i.e.:
While there is a spi transfer pending, keep the clock for the spi module and as soon as no spi transfer pending, disable its clock.

If you then implement a 'clock tree' driver whose interface is used by all drivers, then you can safely disable whole branches when the resource are not needed.
[HR] You are correct, when _sys_soc_suspend is called the power manager service will try to disable whole branches when the resource is not needed.

Regards,
Alex.

From: Rahamim, Hezi [mailto:hezi.rahamim(a)intel.com]
Sent: Tuesday, July 12, 2016 11:03 AM
To: devel(a)lists.zephyrproject.org<mailto:devel(a)lists.zephyrproject.org>
Cc: Kidron, Amihai <amihai.kidron(a)intel.com<mailto:amihai.kidron(a)intel.com>>; Siman-tov, Keren <keren.siman-tov(a)intel.com<mailto:keren.siman-tov(a)intel.com>>
Subject: [devel] [RFC] Power Management Infrastructure

Proposed changes
===============

First proposed change is to have a set state and get state driver functions
instead of the suspend resume functions:

struct device_pm_ops {
int (*set_state)(struct device *device, int device_pm_policy);
int (*get_state)(struct device *device, int device_pm_policy);
};

The set_state function will behave according to the state transition of a specific
driver. E.g. transition from active state to suspend state in a UART device will
save device states and gate the clock.
The get_state function will enable the Power Manager service to know the state
of each driver thus enable it to configure the SoC power behavior.

---------------------------------------------------------------------
A member of the Intel Corporation group of companies

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Join devel@lists.zephyrproject.org to automatically receive all group messages.