[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200306181443.GJ37466@atomide.com>
Date: Fri, 6 Mar 2020 10:14:43 -0800
From: Tony Lindgren <tony@...mide.com>
To: Lokesh Vutla <lokeshvutla@...com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Linux OMAP Mailing List <linux-omap@...r.kernel.org>,
linux-kernel@...r.kernel.org, linux-pwm@...r.kernel.org,
Sekhar Nori <nsekhar@...com>, Vignesh R <vigneshr@...com>,
Sebastian Reichel <sre@...nel.org>
Subject: Re: [PATCH v2 4/6] pwm: omap-dmtimer: Fix pwm disabling sequence
* Lokesh Vutla <lokeshvutla@...com> [200228 09:58]:
> pwm_omap_dmtimer_disable() calls .stop callback which abruptly stops the
> timer counter. This doesn't complete the current pwm cycle and
> immediately disables the pwm. Instead disable the auto reload
> functionality which allows to complete the current pwm cycle and then
> disables the timer.
>
> Signed-off-by: Lokesh Vutla <lokeshvutla@...com>
> ---
> drivers/pwm/pwm-omap-dmtimer.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-omap-dmtimer.c b/drivers/pwm/pwm-omap-dmtimer.c
> index bc338619232d..89b3c25d02b8 100644
> --- a/drivers/pwm/pwm-omap-dmtimer.c
> +++ b/drivers/pwm/pwm-omap-dmtimer.c
> @@ -93,8 +93,16 @@ static void pwm_omap_dmtimer_disable(struct pwm_chip *chip,
> {
> struct pwm_omap_dmtimer_chip *omap = to_pwm_omap_dmtimer_chip(chip);
>
> + /*
> + * Disable auto reload so that the current cycle gets completed and
> + * then the counter stops.
> + */
> mutex_lock(&omap->mutex);
> - omap->pdata->stop(omap->dm_timer);
> + omap->pdata->set_pwm(omap->dm_timer,
> + pwm_get_polarity(pwm) == PWM_POLARITY_INVERSED,
> + true, OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE,
> + false);
> +
> mutex_unlock(&omap->mutex);
> }
I'm seeing an issue with this patch where after use something is
left on and power consumption stays higher by about 30 mW after
use.
I can reproduce this easily on droid4 with Sebastian's rumble-test
app[0]. After use, I sometimes also hear the vibrator keep chirping
quietly, so there seems to be some pwm still happening after disable :)
Reloading modules for pwm-vibra and pwm-omap-dmtimer make the power
consumption go back down again.
If you have a scope set up, maybe check the lines are quiet after
disable after this patch?
Regards,
Tony
[0] https://git.collabora.com/cgit/user/sre/rumble-test.git/plain/rumble-test.c
Powered by blists - more mailing lists