Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1688496

Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state()

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state()
Date 2017-07-16 17:40 +0200
Message-ID <u3TOi-SL-13@gated-at.bofh.it> (permalink)
References (4 earlier) <u3yqt-3OB-5@gated-at.bofh.it> <u3z3b-4id-5@gated-at.bofh.it> <u3A8V-4T3-1@gated-at.bofh.it> <u3MjL-4aC-1@gated-at.bofh.it> <u3S5Q-86e-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 07/16/2017 06:41 AM, Alexandre Belloni wrote:
> On 06/07/2017 at 05:18:19 +0200, Pavel Machek wrote:
>> On Sat 2017-07-15 20:33:58, Alexandre Belloni wrote:
>>> On 15/07/2017 at 10:20:27 -0700, Florian Fainelli wrote:
>>>>> We already have
>>>>>
>>>>> struct regulator_state {
>>>>>        int uV; /* suspend voltage */
>>>>>        unsigned int mode; /* suspend regulator operating mode */
>>>>>        int enabled; /* is regulator enabled in this suspend state */
>>>>>        int disabled; /* is the regulator disabled in this suspend state */
>>>>> };
>>>>>
>>>>>  * struct regulation_constraints - regulator operating constraints.
>>>>>   * @state_disk: State for regulator when system is suspended in disk
>>>>>   * mode.
>>>>>   * @state_mem: State for regulator when system is suspended in mem
>>>>>   * mode.
>>>>>   * @state_standby: State for regulator when system is suspended in
>>>>>   * standby
>>>>>   *                 mode.
>>>>>    
>>>>> . So it seems that maybe we should tell the drivers if we are entering
>>>>> "state_mem" or "state_standby" (something I may have opposed, sorry),
>>>>> then the driver can get neccessary information from regulator
>>>>> framework.
>>>>
>>>> OK, so what would be the mechanism to tell these drivers about the
>>>> system wide suspend state they are entering if it is not via
>>>> platform_suspend_target_state()?
>>>>
>>>> Keep in mind that regulators might be one aspect of what could be
>>>> causing the platform to behave specifically in one suspend state vs.
>>>> another, but there could be pieces of HW within the SoC that can't be
>>>> described with power domains, voltage islands etc. that would still have
>>>> inherent suspend states properties (like memory retention, pin/pad
>>>> controls etc. etc). We still need some mechanism, possibly centralized
>>>>
>>>
>>> I concur, the regulator stuff is one aspect of one of our suspend state
>>> (cutting VDDcore). But we have another state where the main clock (going
>>> to the IPs) is going from a few hundred MHz to 32kHz. This is currently
>>> handled by calling at91_suspend_entering_slow_clock(). I think it is
>>> important to take that into account so we can remove this hack from the
>>> kernel.
>>
>> Cure should not be worse then the disease... and it is in this case.
>>
>> For clocks, take a look at clock framework, perhaps it already has "clock_will_be_suspended"
>> as regulator framework had. If not, implement it.
>>
> 
> See Rafael's comment, currently, the clock framework can't say whether
> the clock will change because it doesn't know anything about the suspend
> target.
> 
>> Same with memory retention, pin/pad controls.
>>
> 
> Same here.

Exactly, here is another side effect of not knowing the platform
suspend/state that I came across on our platforms:

https://patchwork.kernel.org/patch/9561575/

(we later discussed this in details with Linus and this is why this very
patch set is being introduced now)
-- 
Florian

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Florian Fainelli <f.fainelli@gmail.com> - 2017-07-12 20:10 +0200
  Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-15 00:30 +0200
    Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-15 08:30 +0200
      Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-15 14:30 +0200
        Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-15 18:50 +0200
          Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Florian Fainelli <f.fainelli@gmail.com> - 2017-07-15 19:30 +0200
            Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-07-15 20:40 +0200
              Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-16 09:40 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-07-16 15:50 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Florian Fainelli <f.fainelli@gmail.com> - 2017-07-16 17:40 +0200
            Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Mason <slash.tmp@free.fr> - 2017-07-16 01:40 +0200
              Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-16 01:50 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Florian Fainelli <f.fainelli@gmail.com> - 2017-07-16 04:40 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-16 12:40 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2017-07-16 15:40 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-16 20:30 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Florian Fainelli <f.fainelli@gmail.com> - 2017-07-16 17:50 +0200
            Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-16 01:40 +0200
          Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-16 01:40 +0200
            Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-16 09:40 +0200
              Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-16 12:40 +0200
                Re: [RFC 1/2] PM / suspend: Add platform_suspend_target_state() Pavel Machek <pavel@ucw.cz> - 2017-07-16 20:30 +0200

csiph-web