diff options
author | Simon South <simon@simonsouth.net> | 2021-01-19 17:12:08 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2021-01-20 18:13:15 +0100 |
commit | d21ba5d6217bd5a6a696678385906ed1994b380b (patch) | |
tree | 44b17edbeb7329cc6ac4602b57edc0f698317515 /drivers/pwm/pwm-bcm-iproc.c | |
parent | pwm: rockchip: Replace "bus clk" with "PWM clk" (diff) | |
download | linux-d21ba5d6217bd5a6a696678385906ed1994b380b.tar.xz linux-d21ba5d6217bd5a6a696678385906ed1994b380b.zip |
pwm: rockchip: Eliminate potential race condition when probing
Commit 48cf973cae33 ("pwm: rockchip: Avoid glitches on already running
PWMs") introduced a potential race condition in rockchip_pwm_probe(): A
consumer could enable an inactive PWM, or disable a running one, between
rockchip_pwm_probe() registering the device via pwmchip_add() and checking
whether it is enabled (to determine whether it was started by a
bootloader). This could result in a device's PWM clock being either enabled
once more than necessary, potentially causing it to continue running when
no longer needed, or disabled once more than necessary, producing a warning
from the kernel.
Eliminate these possibilities by modifying rockchip_pwm_probe() so it
checks whether a device is enabled before registering it rather than after.
Fixes: 48cf973cae33 ("pwm: rockchip: Avoid glitches on already running PWMs")
Reported-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Simon South <simon@simonsouth.net>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-bcm-iproc.c')
0 files changed, 0 insertions, 0 deletions