* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
@ 2012-06-29 21:04 Jon Hunter
2012-06-30 4:27 ` Shilimkar, Santosh
2012-07-02 17:52 ` Kevin Hilman
0 siblings, 2 replies; 6+ messages in thread
From: Jon Hunter @ 2012-06-29 21:04 UTC (permalink / raw)
To: linux-arm-kernel
Note: Re-sending with updated kernel doc.
The wake-up power domain is an alway-on power domain and so this power domain
does not have a power state status (PM_PWSTST_xxx) register that indicates the
current state. However, during the registering of the wake-up power domain the
state of the domain is queried by calling pwrdm_read_pwrst(). This actually
tries to read a register that does not exist and returns a value of 0 that
indicates that the current state is OFF. The OFF state count of the wake-up
power domain is then set to 1 and the current state to OFF. Both of which are
incorrect.
To fix this, if a power domain only supports the ON state, do not attempt to
read the power state status register and simply return ON as the current power
state.
This is based upon Tony's current linux-omap master branch.
Testing:
- Boot tested on OMAP4460 panda.
- Boot tested on OMAP3430 beagle and validated CORE RET still working (using
Paul's 32k timer patch [1]).
[1] http://marc.info/?l=linux-omap&m=134000053229888&w=2
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap2/powerdomain.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index eefe179..69b36e1 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
*
* Return the powerdomain @pwrdm's current power state. Returns -EINVAL
* if the powerdomain pointer is null or returns the current power state
- * upon success.
+ * upon success. Note that if the power domain only supports the ON state
+ * then just return ON as the current state.
*/
int pwrdm_read_pwrst(struct powerdomain *pwrdm)
{
@@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
if (!pwrdm)
return -EINVAL;
+ if (pwrdm->pwrsts == PWRSTS_ON)
+ return PWRDM_POWER_ON;
+
if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
2012-06-29 21:04 [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status Jon Hunter
@ 2012-06-30 4:27 ` Shilimkar, Santosh
2012-07-02 16:17 ` Jon Hunter
2012-07-02 17:52 ` Kevin Hilman
1 sibling, 1 reply; 6+ messages in thread
From: Shilimkar, Santosh @ 2012-06-30 4:27 UTC (permalink / raw)
To: linux-arm-kernel
+ Paul, Rajendra,
On Sat, Jun 30, 2012 at 2:34 AM, Jon Hunter <jon-hunter@ti.com> wrote:
> Note: Re-sending with updated kernel doc.
>
> The wake-up power domain is an alway-on power domain and so this power domain
> does not have a power state status (PM_PWSTST_xxx) register that indicates the
> current state. However, during the registering of the wake-up power domain the
> state of the domain is queried by calling pwrdm_read_pwrst(). This actually
> tries to read a register that does not exist and returns a value of 0 that
> indicates that the current state is OFF. The OFF state count of the wake-up
> power domain is then set to 1 and the current state to OFF. Both of which are
> incorrect.
>
> To fix this, if a power domain only supports the ON state, do not attempt to
> read the power state status register and simply return ON as the current power
> state.
>
> This is based upon Tony's current linux-omap master branch.
>
> Testing:
> - Boot tested on OMAP4460 panda.
> - Boot tested on OMAP3430 beagle and validated CORE RET still working (using
> ?Paul's 32k timer patch [1]).
>
> [1] http://marc.info/?l=linux-omap&m=134000053229888&w=2
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> ?arch/arm/mach-omap2/powerdomain.c | ? ?6 +++++-
> ?1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eefe179..69b36e1 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
> ?*
> ?* Return the powerdomain @pwrdm's current power state. ? ? ? ?Returns -EINVAL
> ?* if the powerdomain pointer is null or returns the current power state
> - * upon success.
> + * upon success. Note that if the power domain only supports the ON state
> + * then just return ON as the current state.
> ?*/
> ?int pwrdm_read_pwrst(struct powerdomain *pwrdm)
> ?{
> @@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
> ? ? ? ?if (!pwrdm)
> ? ? ? ? ? ? ? ?return -EINVAL;
>
> + ? ? ? if (pwrdm->pwrsts == PWRSTS_ON)
> + ? ? ? ? ? ? ? return PWRDM_POWER_ON;
> +
The patch as such is correct but just wondering whether we should
have some flag rather than above check.
Regards
Santosh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
2012-06-30 4:27 ` Shilimkar, Santosh
@ 2012-07-02 16:17 ` Jon Hunter
2012-07-03 6:30 ` Shilimkar, Santosh
0 siblings, 1 reply; 6+ messages in thread
From: Jon Hunter @ 2012-07-02 16:17 UTC (permalink / raw)
To: linux-arm-kernel
On 06/29/2012 11:27 PM, Shilimkar, Santosh wrote:
> + Paul, Rajendra,
>
> On Sat, Jun 30, 2012 at 2:34 AM, Jon Hunter <jon-hunter@ti.com> wrote:
>> Note: Re-sending with updated kernel doc.
>>
>> The wake-up power domain is an alway-on power domain and so this power domain
>> does not have a power state status (PM_PWSTST_xxx) register that indicates the
>> current state. However, during the registering of the wake-up power domain the
>> state of the domain is queried by calling pwrdm_read_pwrst(). This actually
>> tries to read a register that does not exist and returns a value of 0 that
>> indicates that the current state is OFF. The OFF state count of the wake-up
>> power domain is then set to 1 and the current state to OFF. Both of which are
>> incorrect.
>>
>> To fix this, if a power domain only supports the ON state, do not attempt to
>> read the power state status register and simply return ON as the current power
>> state.
>>
>> This is based upon Tony's current linux-omap master branch.
>>
>> Testing:
>> - Boot tested on OMAP4460 panda.
>> - Boot tested on OMAP3430 beagle and validated CORE RET still working (using
>> Paul's 32k timer patch [1]).
>>
>> [1] http://marc.info/?l=linux-omap&m=134000053229888&w=2
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
>> arch/arm/mach-omap2/powerdomain.c | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>> index eefe179..69b36e1 100644
>> --- a/arch/arm/mach-omap2/powerdomain.c
>> +++ b/arch/arm/mach-omap2/powerdomain.c
>> @@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
>> *
>> * Return the powerdomain @pwrdm's current power state. Returns -EINVAL
>> * if the powerdomain pointer is null or returns the current power state
>> - * upon success.
>> + * upon success. Note that if the power domain only supports the ON state
>> + * then just return ON as the current state.
>> */
>> int pwrdm_read_pwrst(struct powerdomain *pwrdm)
>> {
>> @@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
>> if (!pwrdm)
>> return -EINVAL;
>>
>> + if (pwrdm->pwrsts == PWRSTS_ON)
>> + return PWRDM_POWER_ON;
>> +
> The patch as such is correct but just wondering whether we should
> have some flag rather than above check.
I was wondering that too. I opted not to add a flag because there is
only one such power domain that needs it. However, I can add a flag if
it is preferred.
Cheers
Jon
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
2012-06-29 21:04 [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status Jon Hunter
2012-06-30 4:27 ` Shilimkar, Santosh
@ 2012-07-02 17:52 ` Kevin Hilman
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2012-07-02 17:52 UTC (permalink / raw)
To: linux-arm-kernel
Jon Hunter <jon-hunter@ti.com> writes:
> Note: Re-sending with updated kernel doc.
>
> The wake-up power domain is an alway-on power domain and so this power domain
> does not have a power state status (PM_PWSTST_xxx) register that indicates the
> current state. However, during the registering of the wake-up power domain the
> state of the domain is queried by calling pwrdm_read_pwrst(). This actually
> tries to read a register that does not exist and returns a value of 0 that
> indicates that the current state is OFF. The OFF state count of the wake-up
> power domain is then set to 1 and the current state to OFF. Both of which are
> incorrect.
>
> To fix this, if a power domain only supports the ON state, do not attempt to
> read the power state status register and simply return ON as the current power
> state.
>
> This is based upon Tony's current linux-omap master branch.
>
> Testing:
> - Boot tested on OMAP4460 panda.
> - Boot tested on OMAP3430 beagle and validated CORE RET still working (using
> Paul's 32k timer patch [1]).
>
> [1] http://marc.info/?l=linux-omap&m=134000053229888&w=2
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
> ---
> arch/arm/mach-omap2/powerdomain.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
> index eefe179..69b36e1 100644
> --- a/arch/arm/mach-omap2/powerdomain.c
> +++ b/arch/arm/mach-omap2/powerdomain.c
> @@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
> *
> * Return the powerdomain @pwrdm's current power state. Returns -EINVAL
> * if the powerdomain pointer is null or returns the current power state
> - * upon success.
> + * upon success. Note that if the power domain only supports the ON state
> + * then just return ON as the current state.
> */
> int pwrdm_read_pwrst(struct powerdomain *pwrdm)
> {
> @@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
> if (!pwrdm)
> return -EINVAL;
>
> + if (pwrdm->pwrsts == PWRSTS_ON)
> + return PWRDM_POWER_ON;
> +
> if (arch_pwrdm && arch_pwrdm->pwrdm_read_pwrst)
> ret = arch_pwrdm->pwrdm_read_pwrst(pwrdm);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
2012-07-02 16:17 ` Jon Hunter
@ 2012-07-03 6:30 ` Shilimkar, Santosh
2012-07-04 15:38 ` Paul Walmsley
0 siblings, 1 reply; 6+ messages in thread
From: Shilimkar, Santosh @ 2012-07-03 6:30 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 2, 2012 at 9:47 PM, Jon Hunter <jon-hunter@ti.com> wrote:
>
> On 06/29/2012 11:27 PM, Shilimkar, Santosh wrote:
>> + Paul, Rajendra,
>>
>> On Sat, Jun 30, 2012 at 2:34 AM, Jon Hunter <jon-hunter@ti.com> wrote:
>>> Note: Re-sending with updated kernel doc.
>>>
>>> The wake-up power domain is an alway-on power domain and so this power domain
>>> does not have a power state status (PM_PWSTST_xxx) register that indicates the
>>> current state. However, during the registering of the wake-up power domain the
>>> state of the domain is queried by calling pwrdm_read_pwrst(). This actually
>>> tries to read a register that does not exist and returns a value of 0 that
>>> indicates that the current state is OFF. The OFF state count of the wake-up
>>> power domain is then set to 1 and the current state to OFF. Both of which are
>>> incorrect.
>>>
>>> To fix this, if a power domain only supports the ON state, do not attempt to
>>> read the power state status register and simply return ON as the current power
>>> state.
>>>
>>> This is based upon Tony's current linux-omap master branch.
>>>
>>> Testing:
>>> - Boot tested on OMAP4460 panda.
>>> - Boot tested on OMAP3430 beagle and validated CORE RET still working (using
>>> Paul's 32k timer patch [1]).
>>>
>>> [1] http://marc.info/?l=linux-omap&m=134000053229888&w=2
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> ---
>>> arch/arm/mach-omap2/powerdomain.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
>>> index eefe179..69b36e1 100644
>>> --- a/arch/arm/mach-omap2/powerdomain.c
>>> +++ b/arch/arm/mach-omap2/powerdomain.c
>>> @@ -526,7 +526,8 @@ int pwrdm_read_next_pwrst(struct powerdomain *pwrdm)
>>> *
>>> * Return the powerdomain @pwrdm's current power state. Returns -EINVAL
>>> * if the powerdomain pointer is null or returns the current power state
>>> - * upon success.
>>> + * upon success. Note that if the power domain only supports the ON state
>>> + * then just return ON as the current state.
>>> */
>>> int pwrdm_read_pwrst(struct powerdomain *pwrdm)
>>> {
>>> @@ -535,6 +536,9 @@ int pwrdm_read_pwrst(struct powerdomain *pwrdm)
>>> if (!pwrdm)
>>> return -EINVAL;
>>>
>>> + if (pwrdm->pwrsts == PWRSTS_ON)
>>> + return PWRDM_POWER_ON;
>>> +
>> The patch as such is correct but just wondering whether we should
>> have some flag rather than above check.
>
> I was wondering that too. I opted not to add a flag because there is
> only one such power domain that needs it.
>
I agree with you.
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status
2012-07-03 6:30 ` Shilimkar, Santosh
@ 2012-07-04 15:38 ` Paul Walmsley
0 siblings, 0 replies; 6+ messages in thread
From: Paul Walmsley @ 2012-07-04 15:38 UTC (permalink / raw)
To: linux-arm-kernel
Thanks everyone, queued.
- Paul
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-04 15:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-29 21:04 [PATCH RESEND] ARM: OMAP2+: Fix Wake-up power domain power status Jon Hunter
2012-06-30 4:27 ` Shilimkar, Santosh
2012-07-02 16:17 ` Jon Hunter
2012-07-03 6:30 ` Shilimkar, Santosh
2012-07-04 15:38 ` Paul Walmsley
2012-07-02 17:52 ` Kevin Hilman
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).