All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: "Högander Jouni" <jouni.hogander@nokia.com>
Cc: ext Paul Walmsley <paul@pwsan.com>,
	Tony Lindgren <tony@atomide.com>,
	linux-omap@vger.kernel.org,
	"Stoppa Igor \\(Nokia-D/Helsinki\\)" <Igor.Stoppa@nokia.com>,
	r-woodruff2@ti.com, "Sawant, Anand" <sawant@ti.com>,
	Poussa Sakari <sakari.poussa@nokia.com>
Subject: Re: [PATCH] OMAP3 powerdomains: remove RET from SGX power states list
Date: Tue, 11 Nov 2008 14:00:34 -0800	[thread overview]
Message-ID: <491A0082.4040807@deeprootsystems.com> (raw)
In-Reply-To: <87r65i66j5.fsf@trdhcp146196.ntc.nokia.com>

Högander Jouni wrote:
> "ext Paul Walmsley" <paul@pwsan.com> writes:
> 
>> Hi Jouni,
>>
>> On Fri, 7 Nov 2008, Högander Jouni wrote:
>>
>>> What do you Paul think about patch below:
>> I'm okay with it, but one potential problem: won't this prevent the chip 
>> from entering retention, since SGX will be set to ON?
> 
> Yes, you are right here.
> 
>> Anyway, if you agree this is a problem, what do you think about adding a 
>> powerdomain flag that indicates that the powerdomain next power state 
>> should be set to OFF on initialization, and then testing that in 
>> set_pwrdm_state() ?
> 
> I wouldn't add any flags for this. The goal is finally to set all
> next_states as OFF until someone has set some constraint which
> prevents OFF usage. For now we need to use RET as default, because
> drivers are not supporting OFF mode. Do you agree this?
> 
> Easiest way here would be to add own hook for SGX in pwrdms_setup? One
> more strcmp("*_pwrdm, pwrdm->name) :)
> 
> What do you think?
> 

Personally, I don't like these if statements (or ifdefs) in pwrdms_setup 
or the off_mode_enable hook.  And I would like to see them all disappear.

I would rather see set_pwrdm_state() be smarter by simply not trying
to use a state that is not in its list of allowed states.

Kevin


>> - Paul
>>
>>
>>> From: Jouni Hogander <jouni.hogander@nokia.com>
>>> Date: Fri, 7 Nov 2008 16:50:51 +0200
>>> Subject: [PATCH] OMAP3: PM: Check that wanted state is supported by pwrdm in pwrdms_setup
>>>
>>> Check that wanted sleep state is supported by powerdomain. If it is
>>> not supported, then use next highest supported state.
>>>
>>> Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
>>> ---
>>>  arch/arm/mach-omap2/pm34xx.c |   11 ++++++++++-
>>>  1 files changed, 10 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>>> index da098d2..d9959a8 100644
>>> --- a/arch/arm/mach-omap2/pm34xx.c
>>> +++ b/arch/arm/mach-omap2/pm34xx.c
>>> @@ -515,6 +515,7 @@ static void __init prcm_setup_regs(void)
>>>  static int __init pwrdms_setup(struct powerdomain *pwrdm)
>>>  {
>>>  	struct power_state *pwrst;
>>> +	u32 next_state = PWRDM_POWER_RET;
>>>  
>>>  	if (!pwrdm->pwrsts)
>>>  		return 0;
>>> @@ -523,12 +524,20 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm)
>>>  	if (!pwrst)
>>>  		return -ENOMEM;
>>>  	pwrst->pwrdm = pwrdm;
>>> -	pwrst->next_state = PWRDM_POWER_RET;
>>>  	list_add(&pwrst->node, &pwrst_list);
>>>  
>>>  	if (pwrdm_has_hdwr_sar(pwrdm))
>>>  		pwrdm_enable_hdwr_sar(pwrdm);
>>>  
>>> +	while (!(pwrdm->pwrsts & (1 << next_state))) {
>>> +		if (next_state > PWRDM_POWER_ON) {
>>> +			next_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
>>> +			break;
>>> +		}
>>> +		next_state++;
>>> +	}
>>> +	pwrst->next_state = next_state;
>>> +
>>>  	return set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
>>>  }
>>>  
>>> -- 
>>> 1.6.0.1
>>>
>>>
>>
>> - Paul
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-11-11 22:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 19:39 [PATCH] OMAP3 powerdomains: remove RET from SGX power states list Paul Walmsley
2008-11-06  3:33 ` Tony Lindgren
2008-11-06 11:08   ` Paul Walmsley
2008-11-06 17:01     ` Tony Lindgren
2008-11-07 15:01     ` Högander Jouni
2008-11-10 14:45       ` Paul Walmsley
2008-11-11  7:55         ` Högander Jouni
2008-11-11 22:00           ` Kevin Hilman [this message]
2008-11-12  8:20             ` Högander Jouni
2008-11-14  8:38             ` [PATCH] OMAP3: PM: Check in set_pwrdm_state that target state is supported by pwrdm Jouni Hogander
2008-11-14 17:37               ` Paul Walmsley
2008-11-15  3:27                 ` Paul Walmsley
2008-11-17  8:18                   ` [PATCH] OMAP3: PM: Check in set_pwrdm_state that target state is supported by pwrdm v2 Jouni Hogander
2008-11-18 18:27                     ` Paul Walmsley
2008-11-18 23:55                       ` Kevin Hilman
2008-11-19 18:04                         ` Tony Lindgren
2008-11-12 19:07           ` [PATCH] OMAP3 powerdomains: remove RET from SGX power states list Paul Walmsley
2008-11-19 21:54             ` Steve Sakoman
2008-11-19 22:08               ` Kevin Hilman

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=491A0082.4040807@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=Igor.Stoppa@nokia.com \
    --cc=jouni.hogander@nokia.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=r-woodruff2@ti.com \
    --cc=sakari.poussa@nokia.com \
    --cc=sawant@ti.com \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.