]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: sifive: Reduce time the controller lock is held
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 21 Jul 2022 10:31:25 +0000 (12:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:08 +0000 (16:44 +0100)
commitc0daf3e03fe95cf4861bb81a3cd90baefe44d69b
tree2faa60d722bfbb58f2ea4f14f91dcd4dc4e9f882
parentae7b40948192557fd79226c06a9b1e8a74dc2c8c
pwm: sifive: Reduce time the controller lock is held

[ Upstream commit e0ca9013058e7e7c43370e859619dd81765769b0 ]

The lock is only to serialize access and update to user_count and
approx_period between different PWMs served by the same pwm_chip.
So the lock needs only to be taken during the check if the (chip global)
period can and/or needs to be changed.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Stable-dep-of: 334c7b13d383 ("pwm: sifive: Always let the first pwm_apply_state succeed")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-sifive.c