Skip to contentSkip to conversation

pwm: lpss: Remove ->free() callback

PATCH Applied Mika Westerberg 2 participants 2 messages Dec 9, 2015 – Dec 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: lpss: Remove ->free() callback

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.

---
 drivers/pwm/pwm-lpss.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pwm/pwm-lpss.c +0 -1
index 6063c3dcbd46..ba9f17443843 100644
@@ -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,
Signature · 1 line
2.6.2
#1 lore raw
Quoted 14 lines · Mika Westerberg

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.

Quoted 7 lines

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

---
 drivers/pwm/pwm-lpss.c | 1 -
 1 file changed, 1 deletion(-)

Applied, thanks.

Thierry