linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pwm: lpss: Remove ->free() callback
@ 2015-12-09 14:05 Mika Westerberg
  2015-12-16 15:40 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2015-12-09 14:05 UTC (permalink / raw)
  To: Thierry Reding; +Cc: Qipeng Zha, Mika Westerberg, linux-pwm

The LPSS PWM driver calls pwm_lpss_disable() when the PWM device is
released (for example unexported from sysfs). This in turn calls
pm_runtime_put() which makes runtime PM count to be unbalanced if the
device has not been enabled at this point.

This is easy to reproduce:

  # cd /sys/class/pwm/pwmchip0
  # echo 0 > export
  # echo 0 > unexport

The count is unbalanced and prevents the PWM device from being powered on
next time.

Fix this by removing ->free() callback. There are no resources to be
released anyway.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/pwm/pwm-lpss.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
index 6063c3dcbd46..ba9f17443843 100644
--- a/drivers/pwm/pwm-lpss.c
+++ b/drivers/pwm/pwm-lpss.c
@@ -159,7 +159,6 @@ static void pwm_lpss_disable(struct pwm_chip *chip, struct pwm_device *pwm)
 }
 
 static const struct pwm_ops pwm_lpss_ops = {
-	.free = pwm_lpss_disable,
 	.config = pwm_lpss_config,
 	.enable = pwm_lpss_enable,
 	.disable = pwm_lpss_disable,
-- 
2.6.2

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

* Re: [PATCH] pwm: lpss: Remove ->free() callback
  2015-12-09 14:05 [PATCH] pwm: lpss: Remove ->free() callback Mika Westerberg
@ 2015-12-16 15:40 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2015-12-16 15:40 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: Qipeng Zha, linux-pwm

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On Wed, Dec 09, 2015 at 04:05:59PM +0200, Mika Westerberg wrote:
> The LPSS PWM driver calls pwm_lpss_disable() when the PWM device is
> released (for example unexported from sysfs). This in turn calls
> pm_runtime_put() which makes runtime PM count to be unbalanced if the
> device has not been enabled at this point.
> 
> This is easy to reproduce:
> 
>   # cd /sys/class/pwm/pwmchip0
>   # echo 0 > export
>   # echo 0 > unexport
> 
> The count is unbalanced and prevents the PWM device from being powered on
> next time.
> 
> Fix this by removing ->free() callback. There are no resources to be
> released anyway.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  drivers/pwm/pwm-lpss.c | 1 -
>  1 file changed, 1 deletion(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-12-16 15:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-09 14:05 [PATCH] pwm: lpss: Remove ->free() callback Mika Westerberg
2015-12-16 15:40 ` Thierry Reding

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