linux-stable/drivers/pwm
Simon South d9b657a5cd pwm: rockchip: Enable APB clock during register access while probing
Commit 457f74abbe ("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: 457f74abbe ("pwm: rockchip: Keep enabled PWMs running while probing")
Reported-by: Thierry Reding <thierry.reding@gmail.com>
Suggested-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Simon South <simon@simonsouth.net>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2021-01-20 18:12:31 +01:00
..
core.c pwm: core: Use octal permission 2020-12-17 14:19:00 +01:00
Kconfig pwm: Remove ZTE ZX driver 2021-01-20 17:16:52 +01:00
Makefile pwm: Remove ZTE ZX driver 2021-01-20 17:16:52 +01:00
pwm-ab8500.c pwm: ab8500: Explicitly allocate pwm chip base dynamically 2020-12-17 14:18:48 +01:00
pwm-atmel-hlcdc.c pwm: Ensure pwm_apply_state() doesn't modify the state argument 2019-09-21 03:25:10 +02:00
pwm-atmel-tcb.c pwm: atmel-tcb: Add sama5d2 support 2020-12-17 14:18:55 +01:00
pwm-atmel.c pwm: atmel: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:46 +01:00
pwm-bcm-iproc.c pwm: bcm-iproc: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:42 +01:00
pwm-bcm-kona.c pwm: bcm-kona: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:41 +01:00
pwm-bcm2835.c pwm: bcm2835: Support apply function for atomic configuration 2020-12-17 14:19:01 +01:00
pwm-berlin.c pwm: berlin: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:44 +01:00
pwm-brcmstb.c pwm: brcmstb: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:44 +01:00
pwm-clps711x.c pwm: clps711x: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:45 +01:00
pwm-crc.c pwm: Use -EINVAL for unsupported polarity 2020-12-17 14:18:59 +01:00
pwm-cros-ec.c pwm: cros-ec: Simplify EC error handling 2020-08-24 11:37:34 +02:00
pwm-dwc.c pwm: Add DesignWare PWM Controller Driver 2020-12-17 14:18:58 +01:00
pwm-ep93xx.c pwm: ep93xx: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:39 +01:00
pwm-fsl-ftm.c pwm: fsl-ftm: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:38 +01:00
pwm-hibvt.c pwm: hibvt: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:46 +01:00
pwm-img.c pwm: img: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:45 +01:00
pwm-imx-tpm.c pwm: imx-tpm: Use dev_err_probe() to simplify error handling 2020-12-17 14:18:47 +01:00
pwm-imx1.c pwm: imx1: Use dev_err_probe() to simplify error handling 2020-12-17 14:18:47 +01:00
pwm-imx27.c pwm: imx27: Fix overflow for bigger periods 2020-12-17 14:19:01 +01:00
pwm-intel-lgm.c pwm: Add PWM fan controller driver for LGM SoC 2020-12-17 14:18:59 +01:00
pwm-iqs620a.c pwm: Use -EINVAL for unsupported polarity 2020-12-17 14:18:59 +01:00
pwm-jz4740.c pwm: jz4740: Simplify with dev_err_probe() 2020-09-24 09:18:10 +02:00
pwm-keembay.c pwm: keembay: Fix build failure with -Os 2020-12-17 14:19:00 +01:00
pwm-lp3943.c pwm: lp3943: Dynamically allocate PWM chip base 2020-12-17 14:18:55 +01:00
pwm-lpc18xx-sct.c pwm: lpc18xx-sct: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:46 +01:00
pwm-lpc32xx.c pwm: lpc32xx: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:42 +01:00
pwm-lpss-pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pwm-lpss-platform.c pwm: lpss: Set DPM_FLAG_SMART_SUSPEND on Cherry Trail devices 2020-12-17 14:18:49 +01:00
pwm-lpss.c pwm: lpss: Log error from pwm_lpss_is_updating() if the update bit is still set 2020-12-17 14:18:48 +01:00
pwm-lpss.h pwm: lpss: Remove suspend/resume handlers 2020-09-06 15:38:01 +02:00
pwm-mediatek.c pwm: mediatek: Add MT8183 SoC support 2020-12-17 14:18:58 +01:00
pwm-meson.c pwm: meson: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:42 +01:00
pwm-mtk-disp.c pwm: mtk-disp: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:44 +01:00
pwm-mxs.c pwm: mxs: Remove unused include of of_address.h 2020-03-30 16:55:27 +02:00
pwm-omap-dmtimer.c pwm: Replace HTTP links with HTTPS ones 2020-07-30 11:27:13 +02:00
pwm-pca9685.c pwm: pca9685: Disable unused alternative addresses 2020-09-24 09:18:13 +02:00
pwm-pxa.c pwm: pxa: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:40 +01:00
pwm-rcar.c pwm: Use -EINVAL for unsupported polarity 2020-12-17 14:18:59 +01:00
pwm-renesas-tpu.c pwm: renesas-tpu: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:38 +01:00
pwm-rockchip.c pwm: rockchip: Enable APB clock during register access while probing 2021-01-20 18:12:31 +01:00
pwm-samsung.c pwm: samsung: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:43 +01:00
pwm-sifive.c pwm: sifive: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:46 +01:00
pwm-sl28cpld.c pwm: sl28cpld: Set driver data before registering the PWM chip 2020-12-17 14:19:02 +01:00
pwm-spear.c pwm: spear: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:41 +01:00
pwm-sprd.c pwm: sprd: Simplify with dev_err_probe() 2020-09-24 09:18:11 +02:00
pwm-sti.c pwm: sti: Remove unnecessary blank line 2020-12-17 14:18:59 +01:00
pwm-stm32-lp.c pwm: Convert period and duty cycle to u64 2020-06-17 20:42:11 +02:00
pwm-stm32.c pwm: stm32: Remove automatic output enable 2020-01-20 13:47:36 +01:00
pwm-stmpe.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pwm-sun4i.c pwm: sun4i: Remove erroneous else branch 2020-12-17 14:23:49 +01:00
pwm-tegra.c pwm: tegra: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:39 +01:00
pwm-tiecap.c pwm: tiecap: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:44 +01:00
pwm-tiehrpwm.c pwm: tiehrpwm: Handle deferred probe with dev_err_probe() 2020-12-17 14:18:49 +01:00
pwm-twl-led.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
pwm-twl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
pwm-vt8500.c pwm: vt8500: Convert to devm_platform_ioremap_resource() 2020-12-17 14:18:44 +01:00
sysfs.c pwm: Allow store 64-bit duty cycle from sysfs interface 2020-09-24 09:18:14 +02:00