Re: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-18 Thread Kevin Hilman
On Wed, Nov 18, 2009 at 6:11 AM, Gopinath, Thara  wrote:
>
>
>>>-Original Message-
>>>From: linux-omap-ow...@vger.kernel.org 
>>>[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Kevin
>>>Hilman
>>>Sent: Wednesday, November 18, 2009 12:04 AM
>>>To: Tero Kristo
>>>Cc: linux-omap@vger.kernel.org
>>>Subject: Re: [PATCH] OMAP3: PM: Force write last pad config register into 
>>>save area
>>>
>>>Tero Kristo  writes:
>>>
>>>> From: Tero Kristo 
>>>>
>>>> Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and
>>>> ETK_D15) can fail sometimes when there is simultaneous OCP access to the
>>>> SCM register area. Fixed by writing the last register to the save area.
>>>>
>>>> Also, optimized the delay loop for the HW save to include an udelay(1),
>>>> which limits the number of unnecessary HW accesses to SCM register area
>>>> during the save.
>>>>
>>>> Signed-off-by: Tero Kristo 
>>>
>>>I certainly like this fix much better than the original proposal:
>>>
>>>  http://marc.info/?l=linux-omap&m=125474186609661&w=2
>
> Please do not merge this patch until TI officially confirms the workaround.
>

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


RE: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-18 Thread Gopinath, Thara


>>-Original Message-
>>From: linux-omap-ow...@vger.kernel.org 
>>[mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Kevin
>>Hilman
>>Sent: Wednesday, November 18, 2009 12:04 AM
>>To: Tero Kristo
>>Cc: linux-omap@vger.kernel.org
>>Subject: Re: [PATCH] OMAP3: PM: Force write last pad config register into 
>>save area
>>
>>Tero Kristo  writes:
>>
>>> From: Tero Kristo 
>>>
>>> Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and
>>> ETK_D15) can fail sometimes when there is simultaneous OCP access to the
>>> SCM register area. Fixed by writing the last register to the save area.
>>>
>>> Also, optimized the delay loop for the HW save to include an udelay(1),
>>> which limits the number of unnecessary HW accesses to SCM register area
>>> during the save.
>>>
>>> Signed-off-by: Tero Kristo 
>>
>>I certainly like this fix much better than the original proposal:
>>
>>  http://marc.info/?l=linux-omap&m=125474186609661&w=2

Please do not merge this patch until TI officially confirms the workaround.
>>
>>Pulling into PM branch after s/XYZ/1.157/
>>
>>Kevin
>>
>>> ---
>>>  arch/arm/mach-omap2/pm34xx.c |   10 +-
>>>  1 files changed, 9 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
>>> index 4b01303..4ead40e 100644
>>> --- a/arch/arm/mach-omap2/pm34xx.c
>>> +++ b/arch/arm/mach-omap2/pm34xx.c
>>> @@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
>>> /* wait for the save to complete */
>>> while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
>>> & PADCONF_SAVE_DONE))
>>> -   ;
>>> +   udelay(1);
>>> +
>>> +   /*
>>> +* Force write last pad into memory, as this can fail in some
>>> +* cases according to errata XYZ
>>> +*/
>>> +   omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
>>> +   OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
>>> +
>>> /* Save the Interrupt controller context */
>>> omap_intc_save_context();
>>> /* Save the GPMC context */
>>> --
>>> 1.5.4.3
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>>> the body of a message to majord...@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>--
>>To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>>the body of a message to majord...@vger.kernel.org
>>More majordomo info at  http://vger.kernel.org/majordomo-info.html

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


RE: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-18 Thread Tero.Kristo
 

>-Original Message-
>From: ext Kevin Hilman [mailto:khil...@deeprootsystems.com] 
>Sent: 17 November, 2009 20:34
>To: Kristo Tero (Nokia-D/Tampere)
>Cc: linux-omap@vger.kernel.org
>Subject: Re: [PATCH] OMAP3: PM: Force write last pad config 
>register into save area
>
>Tero Kristo  writes:
>
>> From: Tero Kristo 
>>
>> Due to OMAP3 errata XYZ, the save of the last pad register 
>(ETK_D14 and
>> ETK_D15) can fail sometimes when there is simultaneous OCP 
>access to the
>> SCM register area. Fixed by writing the last register to the 
>save area.
>>
>> Also, optimized the delay loop for the HW save to include an 
>udelay(1),
>> which limits the number of unnecessary HW accesses to SCM 
>register area
>> during the save.
>>
>> Signed-off-by: Tero Kristo 
>
>I certainly like this fix much better than the original proposal:
>
>  http://marc.info/?l=linux-omap&m=125474186609661&w=2
>
>Pulling into PM branch after s/XYZ/1.157/

I will resend the patch when TI has confirmed the errata number. This version 
of the patch was also missing an "#include " for the udelay, I 
missed this in the hurry, so I will add this one also.

-Tero

>
>> ---
>>  arch/arm/mach-omap2/pm34xx.c |   10 +-
>>  1 files changed, 9 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/pm34xx.c 
>b/arch/arm/mach-omap2/pm34xx.c
>> index 4b01303..4ead40e 100644
>> --- a/arch/arm/mach-omap2/pm34xx.c
>> +++ b/arch/arm/mach-omap2/pm34xx.c
>> @@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
>>  /* wait for the save to complete */
>>  while 
>(!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
>>  & PADCONF_SAVE_DONE))
>> -;
>> +udelay(1);
>> +
>> +/*
>> + * Force write last pad into memory, as this can fail in some
>> + * cases according to errata XYZ
>> + */
>> +omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
>> +OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
>> +
>>  /* Save the Interrupt controller context */
>>  omap_intc_save_context();
>>  /* Save the GPMC context */
>> -- 
>> 1.5.4.3
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe 
>linux-omap" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-17 Thread Kevin Hilman
Tero Kristo  writes:

> From: Tero Kristo 
>
> Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and
> ETK_D15) can fail sometimes when there is simultaneous OCP access to the
> SCM register area. Fixed by writing the last register to the save area.
>
> Also, optimized the delay loop for the HW save to include an udelay(1),
> which limits the number of unnecessary HW accesses to SCM register area
> during the save.
>
> Signed-off-by: Tero Kristo 

I certainly like this fix much better than the original proposal:

  http://marc.info/?l=linux-omap&m=125474186609661&w=2

Pulling into PM branch after s/XYZ/1.157/

Kevin

> ---
>  arch/arm/mach-omap2/pm34xx.c |   10 +-
>  1 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 4b01303..4ead40e 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
>   /* wait for the save to complete */
>   while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
>   & PADCONF_SAVE_DONE))
> - ;
> + udelay(1);
> +
> + /*
> +  * Force write last pad into memory, as this can fail in some
> +  * cases according to errata XYZ
> +  */
> + omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
> + OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
> +
>   /* Save the Interrupt controller context */
>   omap_intc_save_context();
>   /* Save the GPMC context */
> -- 
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-17 Thread Gadiyar, Anand
Tero Kristo wrote:
> From: Tero Kristo 
> 
> Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and

XYZ is 1.157

> ETK_D15) can fail sometimes when there is simultaneous OCP access to the
> SCM register area. Fixed by writing the last register to the save area.
> 
> Also, optimized the delay loop for the HW save to include an udelay(1),
> which limits the number of unnecessary HW accesses to SCM register area
> during the save.
> 
> Signed-off-by: Tero Kristo 
> ---
>  arch/arm/mach-omap2/pm34xx.c |   10 +-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 4b01303..4ead40e 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
> /* wait for the save to complete */
> while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
> & PADCONF_SAVE_DONE))
> -   ;
> +   udelay(1);
> +
> +   /*
> +* Force write last pad into memory, as this can fail in some
> +* cases according to errata XYZ

And here too.

> +*/
> +   omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
> +   OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
> +
> /* Save the Interrupt controller context */
> omap_intc_save_context();
> /* Save the GPMC context */
> --
> 1.5.4.3
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-17 Thread Nishanth Menon

Tero Kristo had written, on 11/17/2009 10:34 AM, the following:

From: Tero Kristo 

Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and
ETK_D15) can fail sometimes when there is simultaneous OCP access to the
SCM register area. Fixed by writing the last register to the save area.

Also, optimized the delay loop for the HW save to include an udelay(1),
which limits the number of unnecessary HW accesses to SCM register area
during the save.

Nitpicky minor comment: Should we split this out?

Also, this replaces the patch discussed under: 
http://marc.info/?t=12547419204&r=1&w=2




Signed-off-by: Tero Kristo 

Acked-by: Nishanth Menon 


---
 arch/arm/mach-omap2/pm34xx.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4b01303..4ead40e 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
/* wait for the save to complete */
while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
& PADCONF_SAVE_DONE))
-   ;
+   udelay(1);
+
+   /*
+* Force write last pad into memory, as this can fail in some
+* cases according to errata XYZ
+*/
+   omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
+   OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
+
/* Save the Interrupt controller context */
omap_intc_save_context();
/* Save the GPMC context */



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


[PATCH] OMAP3: PM: Force write last pad config register into save area

2009-11-17 Thread Tero Kristo
From: Tero Kristo 

Due to OMAP3 errata XYZ, the save of the last pad register (ETK_D14 and
ETK_D15) can fail sometimes when there is simultaneous OCP access to the
SCM register area. Fixed by writing the last register to the save area.

Also, optimized the delay loop for the HW save to include an udelay(1),
which limits the number of unnecessary HW accesses to SCM register area
during the save.

Signed-off-by: Tero Kristo 
---
 arch/arm/mach-omap2/pm34xx.c |   10 +-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4b01303..4ead40e 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -155,7 +155,15 @@ static void omap3_core_save_context(void)
/* wait for the save to complete */
while (!(omap_ctrl_readl(OMAP343X_CONTROL_GENERAL_PURPOSE_STATUS)
& PADCONF_SAVE_DONE))
-   ;
+   udelay(1);
+
+   /*
+* Force write last pad into memory, as this can fail in some
+* cases according to errata XYZ
+*/
+   omap_ctrl_writel(omap_ctrl_readl(OMAP343X_PADCONF_ETK_D14),
+   OMAP343X_CONTROL_MEM_WKUP + 0x2a0);
+
/* Save the Interrupt controller context */
omap_intc_save_context();
/* Save the GPMC context */
-- 
1.5.4.3

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