pwm: sun4i: Move pwm_calculate() out of spin_lock()
authorClément Péron <peron.clem@gmail.com>
Mon, 13 Jan 2020 09:23:13 +0000 (10:23 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 20 Jan 2020 12:17:33 +0000 (13:17 +0100)
commit3e954d9626895d374704bb49a8fb538a974ebcf5
treec16e336d98282ca0a00a6aec8a62e69d6403d147
parent9f2919e9b40ec480609ee1f45567531de06ab3fe
pwm: sun4i: Move pwm_calculate() out of spin_lock()

pwm_calculate() calls clk_get_rate() while holding a spin_lock().

This create an issue as clk_get_rate() may sleep.

Move pwm_calculate() out of this spin_lock().

Fixes: c32c5c50d4fe ("pwm: sun4i: Switch to atomic PWM")
Reported-by: Alexander Finger <alex.mobigo@gmail.com>
Sugested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Tested-by: Alexander Finger <alex.mobigo@gmail.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Clément Péron <peron.clem@gmail.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-sun4i.c