]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pwm: berlin: Fix wrong register in suspend/resume
authorJisheng Zhang <jszhang@kernel.org>
Tue, 19 Aug 2025 11:42:24 +0000 (19:42 +0800)
committerUwe Kleine-König <ukleinek@kernel.org>
Mon, 15 Sep 2025 09:39:43 +0000 (11:39 +0200)
The 'enable' register should be BERLIN_PWM_EN rather than
BERLIN_PWM_ENABLE, otherwise, the driver accesses wrong address, there
will be cpu exception then kernel panic during suspend/resume.

Fixes: bbf0722c1c66 ("pwm: berlin: Add suspend/resume support")
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20250819114224.31825-1-jszhang@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-berlin.c

index 831aed228cafcb63e38b5e6b8f48a20ec8fc5ff4..858d369913742cda133ad6705b70666f3b5ecdca 100644 (file)
@@ -234,7 +234,7 @@ static int berlin_pwm_suspend(struct device *dev)
        for (i = 0; i < chip->npwm; i++) {
                struct berlin_pwm_channel *channel = &bpc->channel[i];
 
-               channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_ENABLE);
+               channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_EN);
                channel->ctrl = berlin_pwm_readl(bpc, i, BERLIN_PWM_CONTROL);
                channel->duty = berlin_pwm_readl(bpc, i, BERLIN_PWM_DUTY);
                channel->tcnt = berlin_pwm_readl(bpc, i, BERLIN_PWM_TCNT);
@@ -262,7 +262,7 @@ static int berlin_pwm_resume(struct device *dev)
                berlin_pwm_writel(bpc, i, channel->ctrl, BERLIN_PWM_CONTROL);
                berlin_pwm_writel(bpc, i, channel->duty, BERLIN_PWM_DUTY);
                berlin_pwm_writel(bpc, i, channel->tcnt, BERLIN_PWM_TCNT);
-               berlin_pwm_writel(bpc, i, channel->enable, BERLIN_PWM_ENABLE);
+               berlin_pwm_writel(bpc, i, channel->enable, BERLIN_PWM_EN);
        }
 
        return 0;