Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: tiehrpwm: Don't drop runtime PM reference in .free()

The pwm driver calls pm_runtime_get_sync() when the hardware becomes
enabled and pm_runtime_put_sync() when it becomes disabled. The PWM's
state is kept when a consumer goes away, so the call to
pm_runtime_put_sync() in the .free() callback is unbalanced resulting in
a non-functional device and a reference underlow for the second consumer.

The easiest fix for that issue is to just not drop the runtime PM
reference in .free(), so do that.

Fixes: 19891b20e7c2 ("pwm: pwm-tiehrpwm: PWM driver support for EHRPWM")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/bbb089c4b5650cc1f7b25cf582d817543fd25384.1754927682.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Uwe Kleine-König and committed by
Uwe Kleine-König
21a5e91f afe87227

-5
-5
drivers/pwm/pwm-tiehrpwm.c
··· 391 391 { 392 392 struct ehrpwm_pwm_chip *pc = to_ehrpwm_pwm_chip(chip); 393 393 394 - if (pwm_is_enabled(pwm)) { 395 - dev_warn(pwmchip_parent(chip), "Removing PWM device without disabling\n"); 396 - pm_runtime_put_sync(pwmchip_parent(chip)); 397 - } 398 - 399 394 /* set period value to zero on free */ 400 395 pc->period_cycles[pwm->hwpwm] = 0; 401 396 }