diff mbox

gpio-omap: Edge interrupts stall

Message ID 20170324175703.GD10760@atomide.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tony Lindgren March 24, 2017, 5:57 p.m. UTC
* Tony Lindgren <tony@atomide.com> [170324 10:51]:
> If something like the untested patch below helps, then we might be
> able to optimize thing a bit. We need to check if something has to
> be configured in the PER retention case though.
>
> 8< ---------------
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -229,7 +229,8 @@ void omap_sram_idle(void)
>  	/* PER */
>  	if (per_next_state < PWRDM_POWER_ON) {
>  		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
> -		omap2_gpio_prepare_for_idle(per_going_off);
> +		if (per_going_off)
> +			omap2_gpio_prepare_for_idle(per_going_off);
>  	}
>  
>  	/* CORE */

And that will lead into unpaired pm_runtime_calls. Here's a better
experimental patch that seems to increase runtime power consumption
by 30mW, need to check more though. Off mode idle consumption is not
effected. But if that helps Ladis then we can investigate further.

Regards,

Tony

8< ----------------------
--
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

Comments

Tony Lindgren March 24, 2017, 6:04 p.m. UTC | #1
* Tony Lindgren <tony@atomide.com> [170324 10:59]:
> * Tony Lindgren <tony@atomide.com> [170324 10:51]:
> > If something like the untested patch below helps, then we might be
> > able to optimize thing a bit. We need to check if something has to
> > be configured in the PER retention case though.
> >
> > 8< ---------------
> > diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> > --- a/arch/arm/mach-omap2/pm34xx.c
> > +++ b/arch/arm/mach-omap2/pm34xx.c
> > @@ -229,7 +229,8 @@ void omap_sram_idle(void)
> >  	/* PER */
> >  	if (per_next_state < PWRDM_POWER_ON) {
> >  		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
> > -		omap2_gpio_prepare_for_idle(per_going_off);
> > +		if (per_going_off)
> > +			omap2_gpio_prepare_for_idle(per_going_off);
> >  	}
> >  
> >  	/* CORE */
> 
> And that will lead into unpaired pm_runtime_calls. Here's a better
> experimental patch that seems to increase runtime power consumption
> by 30mW, need to check more though. Off mode idle consumption is not
> effected. But if that helps Ladis then we can investigate further.

Hmm actually this patch causes no change in runtime power consumption
for me, it must be something else doing it. So you yeah the below might
be doable, needs to be tested properly though to make sure nothing
else breaks.

Regards,

Tony

> 8< ----------------------
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -197,7 +197,6 @@ void omap_sram_idle(void)
>  	int mpu_next_state = PWRDM_POWER_ON;
>  	int per_next_state = PWRDM_POWER_ON;
>  	int core_next_state = PWRDM_POWER_ON;
> -	int per_going_off;
>  	u32 sdrc_pwr = 0;
>  
>  	mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
> @@ -227,10 +226,8 @@ void omap_sram_idle(void)
>  	pwrdm_pre_transition(NULL);
>  
>  	/* PER */
> -	if (per_next_state < PWRDM_POWER_ON) {
> -		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
> -		omap2_gpio_prepare_for_idle(per_going_off);
> -	}
> +	if (per_next_state == PWRDM_POWER_OFF)
> +		omap2_gpio_prepare_for_idle(true);
>  
>  	/* CORE */
>  	if (core_next_state < PWRDM_POWER_ON) {
> @@ -295,7 +292,7 @@ void omap_sram_idle(void)
>  	pwrdm_post_transition(NULL);
>  
>  	/* PER */
> -	if (per_next_state < PWRDM_POWER_ON)
> +	if (per_next_state == PWRDM_POWER_OFF)
>  		omap2_gpio_resume_after_idle();
>  }
>  
> --
> 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
--
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
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -197,7 +197,6 @@  void omap_sram_idle(void)
 	int mpu_next_state = PWRDM_POWER_ON;
 	int per_next_state = PWRDM_POWER_ON;
 	int core_next_state = PWRDM_POWER_ON;
-	int per_going_off;
 	u32 sdrc_pwr = 0;
 
 	mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
@@ -227,10 +226,8 @@  void omap_sram_idle(void)
 	pwrdm_pre_transition(NULL);
 
 	/* PER */
-	if (per_next_state < PWRDM_POWER_ON) {
-		per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
-		omap2_gpio_prepare_for_idle(per_going_off);
-	}
+	if (per_next_state == PWRDM_POWER_OFF)
+		omap2_gpio_prepare_for_idle(true);
 
 	/* CORE */
 	if (core_next_state < PWRDM_POWER_ON) {
@@ -295,7 +292,7 @@  void omap_sram_idle(void)
 	pwrdm_post_transition(NULL);
 
 	/* PER */
-	if (per_next_state < PWRDM_POWER_ON)
+	if (per_next_state == PWRDM_POWER_OFF)
 		omap2_gpio_resume_after_idle();
 }