Patch "pwm: rockchip: Keep enabled PWMs running while probing" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    pwm: rockchip: Keep enabled PWMs running while probing

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pwm-rockchip-keep-enabled-pwms-running-while-probing.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0a6286cd9ce2e4dcd40fc904e2472a535f315d16
Author: Simon South <simon@xxxxxxxxxxxxxx>
Date:   Sat Sep 19 15:33:06 2020 -0400

    pwm: rockchip: Keep enabled PWMs running while probing
    
    [ Upstream commit 457f74abbed060a0395f75ab5297f2d76cada516 ]
    
    Following commit cfc4c189bc70 ("pwm: Read initial hardware state at
    request time") the Rockchip PWM driver can no longer assume a device's
    pwm_state structure has been populated after a call to pwmchip_add().
    Consequently, the test in rockchip_pwm_probe() intended to prevent the
    driver from stopping PWM devices already enabled by the bootloader no
    longer functions reliably and this can lead to the kernel hanging
    during startup, particularly on devices like the Pinebook Pro that use
    a PWM-controlled backlight for their display.
    
    Avoid this by querying the device directly at probe time to determine
    whether or not it is enabled.
    
    Fixes: cfc4c189bc70 ("pwm: Read initial hardware state at request time")
    Signed-off-by: Simon South <simon@xxxxxxxxxxxxxx>
    Reviewed-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
    Reviewed-by: Heiko Stuebner <heiko@xxxxxxxxx>
    Signed-off-by: Thierry Reding <thierry.reding@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pwm/pwm-rockchip.c b/drivers/pwm/pwm-rockchip.c
index eb8c9cb645a6c..098e94335cb5b 100644
--- a/drivers/pwm/pwm-rockchip.c
+++ b/drivers/pwm/pwm-rockchip.c
@@ -288,6 +288,7 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
 	const struct of_device_id *id;
 	struct rockchip_pwm_chip *pc;
 	struct resource *r;
+	u32 enable_conf, ctrl;
 	int ret, count;
 
 	id = of_match_device(rockchip_pwm_dt_ids, &pdev->dev);
@@ -362,7 +363,9 @@ static int rockchip_pwm_probe(struct platform_device *pdev)
 	}
 
 	/* Keep the PWM clk enabled if the PWM appears to be up and running. */
-	if (!pwm_is_enabled(pc->chip.pwms))
+	enable_conf = pc->data->enable_conf;
+	ctrl = readl_relaxed(pc->base + pc->data->regs.ctrl);
+	if ((ctrl & enable_conf) != enable_conf)
 		clk_disable(pc->clk);
 
 	return 0;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux