linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
@ 2017-11-10 11:26 Keerthy
  2017-11-27 16:59 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Keerthy @ 2017-11-10 11:26 UTC (permalink / raw)
  To: tony
  Cc: linux-arm-kernel, rnayak, linux-omap, linux-kernel, j-keerthy, t-kristo

Referring TRM Am335X series:
http://www.ti.com/lit/ug/spruh73p/spruh73p.pdf

The LastPowerStateEntered bitfield is present only for PM_CEFUSE
domain. This is not present in any of the other power domains. Hence
remove the generic am33xx_pwrdm_read_prev_pwrst hook which wrongly
reads the reserved bit fields for all the other power domains.

Reading the reserved bits leads to wrongly interpreting the low
power transitions for various power domains that do not have the
LastPowerStateEntered field. The pm debug counters values are wrong
currently as we are incrementing them based on the reserved bits.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---
 arch/arm/mach-omap2/prm33xx.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/arch/arm/mach-omap2/prm33xx.c b/arch/arm/mach-omap2/prm33xx.c
index bc5df8d..dfca8d9 100644
--- a/arch/arm/mach-omap2/prm33xx.c
+++ b/arch/arm/mach-omap2/prm33xx.c
@@ -176,17 +176,6 @@ static int am33xx_pwrdm_read_pwrst(struct powerdomain *pwrdm)
 	return v;
 }
 
-static int am33xx_pwrdm_read_prev_pwrst(struct powerdomain *pwrdm)
-{
-	u32 v;
-
-	v = am33xx_prm_read_reg(pwrdm->prcm_offs, pwrdm->pwrstst_offs);
-	v &= AM33XX_LASTPOWERSTATEENTERED_MASK;
-	v >>= AM33XX_LASTPOWERSTATEENTERED_SHIFT;
-
-	return v;
-}
-
 static int am33xx_pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm)
 {
 	am33xx_prm_rmw_reg_bits(AM33XX_LOWPOWERSTATECHANGE_MASK,
@@ -386,7 +375,6 @@ struct pwrdm_ops am33xx_pwrdm_operations = {
 	.pwrdm_set_next_pwrst		= am33xx_pwrdm_set_next_pwrst,
 	.pwrdm_read_next_pwrst		= am33xx_pwrdm_read_next_pwrst,
 	.pwrdm_read_pwrst		= am33xx_pwrdm_read_pwrst,
-	.pwrdm_read_prev_pwrst		= am33xx_pwrdm_read_prev_pwrst,
 	.pwrdm_set_logic_retst		= am33xx_pwrdm_set_logic_retst,
 	.pwrdm_read_logic_pwrst		= am33xx_pwrdm_read_logic_pwrst,
 	.pwrdm_read_logic_retst		= am33xx_pwrdm_read_logic_retst,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
  2017-11-10 11:26 [PATCH] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function Keerthy
@ 2017-11-27 16:59 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2017-11-27 16:59 UTC (permalink / raw)
  To: Keerthy; +Cc: linux-arm-kernel, rnayak, linux-omap, linux-kernel, t-kristo

* Keerthy <j-keerthy@ti.com> [171110 03:29]:
> Referring TRM Am335X series:
> http://www.ti.com/lit/ug/spruh73p/spruh73p.pdf
> 
> The LastPowerStateEntered bitfield is present only for PM_CEFUSE
> domain. This is not present in any of the other power domains. Hence
> remove the generic am33xx_pwrdm_read_prev_pwrst hook which wrongly
> reads the reserved bit fields for all the other power domains.
> 
> Reading the reserved bits leads to wrongly interpreting the low
> power transitions for various power domains that do not have the
> LastPowerStateEntered field. The pm debug counters values are wrong
> currently as we are incrementing them based on the reserved bits.
> 
> Signed-off-by: Keerthy <j-keerthy@ti.com>

Applying into omap-for-v4.15/fixes thanks.

Tony

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-27 16:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 11:26 [PATCH] ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function Keerthy
2017-11-27 16:59 ` Tony Lindgren

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).