pwm: rockchip: Eliminate potential race condition when probing
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest5 patches 1 replyIn review
- v37 patches 15 repliesSuperseded
- v23 patches 9 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 1 patch | 4 replies | Superseded |
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | pwm: rockchip: Enable APB clock during register access while probingdrivers/ | +5 | 0 replies | |
| 2/5 | pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()drivers/ | +0 | 0 replies | |
| 3/5 | pwm: rockchip: Replace "bus clk" with "PWM clk"drivers/ | +2 | 0 replies | |
| 4/5 | pwm: rockchip: Eliminate potential race condition when probingdrivers/ | +6 | 0 replies | |
| 5/5 | pwm: rockchip: Enable clock before calling clk_get_rate()drivers/ | +10 | 1 reply |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | Uwe Kleine-König |
|---|---|
| 1/5 | |
| 2/5 | |
| 3/5 | |
| 4/5 | |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/5] pwm: rockchip: Eliminate potential race condition when probing
This patch series eliminates the race condition Trent Piepho identified[0] in the Rockchip PWM driver's rockchip_pwm_probe() function, by moving code that checks whether a device is enabled ahead of the code that registers it via pwmchip_add().
It includes several other small fixes and improvements to the driver as well: It also
- Fixes a potential kernel hang introduced by my earlier commit 457f74abbed0 ("pwm: rockchip: Keep enabled PWMs running while probing") by ensuring a device's APB clock is enabled before its registers are accessed;
- Removes a superfluous call to clk_unprepare() that could produce warnings from the kernel;
- Clarifies error messages from the driver by replacing "bus clk" with "PWM clk"; and
- Ensures the driver enables a clock before querying its rate with clk_get_rate(), as stated as a requirement in that function's documentation.
This version of the series incorporates Uwe Kleine-König's feedback on v3 and includes these changes:
- Patch 1's commit message has been edited slightly to improve readability, and the error message updated by the patch now reads "prepare enable" rather than just "enable" for consistency with the error message above it in the code.
- Patch 3's commit message now mentions consistency with the device tree.
- Patch 4 has been simplified and now just moves the device-enabled check ahead of the call to pwmchip_add(). It no longers changes any error-handling behaviour, and an extraneous pair of parentheses has been removed.
Patches 2 and 5 are unchanged from v3, while the remaining 2 patches present in v3 (which removed goto targets from and reordered some operations in rockchip_pwm_probe()) have been dropped.
I've tested these changes on my Pinebook Pro (RK3399 with a PWM-driven backlight enabled by U-Boot) and ROCK64 (RK3328) and they appear to work fine.
[0] https://www.spinics.net/lists/linux-pwm/msg14611.html
--
Simon South
[email protected]
Simon South (5):
pwm: rockchip: Enable APB clock during register access while probing
pwm: rockchip: rockchip_pwm_probe(): Remove superfluous
clk_unprepare()
pwm: rockchip: Replace "bus clk" with "PWM clk"
pwm: rockchip: Eliminate potential race condition when probing
pwm: rockchip: Enable clock before calling clk_get_rate()
drivers/pwm/pwm-rockchip.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-)
Signature · 7 lines
2.30.0 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip