public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Barada <peter.barada@gmail.com>
To: Kevin Hilman <khilman@ti.com>
Cc: Peter Barada <peter.barada@gmail.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: Module + offset calculations have to be signed in arch/arm/mach-omap2/pm-debug.c
Date: Thu, 05 May 2011 13:18:59 -0400	[thread overview]
Message-ID: <4DC2DC03.4020200@gmail.com> (raw)
In-Reply-To: <87liyljcnd.fsf@ti.com>

On 05/05/2011 01:11 PM, Kevin Hilman wrote:
> Peter Barada<peter.barada@gmail.com>  writes:
>
>> I've been working on getting the TI OMAPPSP-03.00.01.06 kernel to
>> properly suspend/resume on my DM37x board and all was going well until
>> I added OTG support to the kernel and on suspend, the IVA2 and CORE
>> pwrdms would not properly go into suspend.  When comparing output from
>> /debug/pm-debug/registers/current to the TRM, I noticed the following:
>>
>> MOD: CM_IVA2 (48014000)
>>    04 =>  00000017  20 =>  00000001  24 =>  00000001  34 =>  00000001
>>    40 =>  00080a00  44 =>  00000001  48 =>  00000003
>> MOD: PRM_IVA2 (48316000)
>>    50 =>  00000007  e0 =>  00ff0f05  e4 =>  00000ff7  e8 =>  00000ff7
>>    f8 =>  00000001
>>
>> Looking at the TRM, the PRM_IVA2 registers are at 0x48306000, not
>> 0x48316000.  OMAP3430_IVA2_MOD is defined in prcm-common.h as -0x800
>> which means any module + reg_offset address calculation has to be
>> signed.  Once I corrected the "unsigned short offset" declaration in
>> pm_module_def, rebuilt and tested again, IVA2/core pwrdms go into
>> suspend correctly (and addresses look correct):
> Just to be clear, this should only affect the display of the registers,
> not whether or not the power domains actually suspend correctly, right?
>
> Or, did you actually notice via some other method that this powerdomain
> was not hitting retention/off?
Yes the change affects the registers displayed, but since the address 
calculation is incorrect with CONFIG_PM_DEBUG enabled, the PM_DEBUG code 
is reading the CM_IVA2/PRM_IVA2 registers at incorrect addresses.  On my 
DM37x board when I suspended with OTG enabled (and without the patch), I 
see the following on resume:

[  496.168151] Powerdomain (iva2_pwrdm) didn't enter target state 1 
(last power state 3)
[  496.176025] Powerdomain (core_pwrdm) didn't enter target state 1 
(last power state 3)
[  496.183898] Could not enter target state in pm_suspend

With the patch (and same kernel config) I see the following on resume:

[  234.867889] Successfully put all powerdomains to target state

Before enabling the OTG code all powerdomains went into suspend.

It could be that accessing registers at the incorrect addresses is 
causing DM37x to keep those domains out of retention...

> Kevin
>
>> Signed-off-by: Peter Barada<peter.barada@logicpd.com>
>>
>>
>> diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
>> index 125f565..b731ef3 100644
>> --- a/arch/arm/mach-omap2/pm-debug.c
>> +++ b/arch/arm/mach-omap2/pm-debug.c
>> @@ -199,7 +199,7 @@ enum {
>>   struct pm_module_def {
>>       char name[8]; /* Name of the module */
>>       short type; /* CM or PRM */
>> -    unsigned short offset;
>> +    short offset;
>>       int low; /* First register address on this module */
>>       int high; /* Last register address on this module */
>>   };
> --
> 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


-- 
Peter Barada
peter.barada@gmail.com


  reply	other threads:[~2011-05-05 17:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 16:22 Module + offset calculations have to be signed in arch/arm/mach-omap2/pm-debug.c Peter Barada
2011-05-05 17:11 ` Kevin Hilman
2011-05-05 17:18   ` Peter Barada [this message]
2011-05-05 18:16     ` Kevin Hilman
2011-05-05 19:30       ` Peter Barada
2011-05-05 20:11         ` Kevin Hilman
2011-05-06 15:25       ` Peter Barada
2011-05-06 19:55         ` 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=4DC2DC03.4020200@gmail.com \
    --to=peter.barada@gmail.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox