Commit bac46ff8 authored by Simon South's avatar Simon South Committed by Zheng Zengkai
Browse files

pwm: rockchip: Enable APB clock during register access while probing



stable inclusion
from stable-5.10.20
commit 39ab0927e7b2f20ce2a8f8655de9d9ca2bdb3ee5
bugzilla: 50608

--------------------------------

[ Upstream commit d9b657a5 ]

Commit 457f74ab ("pwm: rockchip: Keep enabled PWMs running while
probing") modified rockchip_pwm_probe() to access a PWM device's registers
directly to check whether or not the device is enabled, but did not also
change the function so it first enables the device's APB clock to be
certain the device can respond. This risks hanging the kernel on systems
with PWM devices that use more than a single clock.

Avoid this by enabling the device's APB clock before accessing its
registers (and disabling the clock when register access is complete).

Fixes: 457f74ab ("pwm: rockchip: Keep enabled PWMs running while probing")
Reported-by: default avatarThierry Reding <thierry.reding@gmail.com>
Suggested-by: default avatarTrent Piepho <tpiepho@gmail.com>
Signed-off-by: default avatarSimon South <simon@simonsouth.net>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 159426eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment