Skip to content

Commit d9457e6

Browse files
xhackerustcgregkh
authored andcommitted
pwm: berlin: Fix wrong register in suspend/resume
commit 3a4b9d0 upstream. 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: bbf0722 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e5505b3 commit d9457e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pwm/pwm-berlin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static int berlin_pwm_suspend(struct device *dev)
234234
for (i = 0; i < chip->npwm; i++) {
235235
struct berlin_pwm_channel *channel = &bpc->channel[i];
236236

237-
channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_ENABLE);
237+
channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_EN);
238238
channel->ctrl = berlin_pwm_readl(bpc, i, BERLIN_PWM_CONTROL);
239239
channel->duty = berlin_pwm_readl(bpc, i, BERLIN_PWM_DUTY);
240240
channel->tcnt = berlin_pwm_readl(bpc, i, BERLIN_PWM_TCNT);
@@ -262,7 +262,7 @@ static int berlin_pwm_resume(struct device *dev)
262262
berlin_pwm_writel(bpc, i, channel->ctrl, BERLIN_PWM_CONTROL);
263263
berlin_pwm_writel(bpc, i, channel->duty, BERLIN_PWM_DUTY);
264264
berlin_pwm_writel(bpc, i, channel->tcnt, BERLIN_PWM_TCNT);
265-
berlin_pwm_writel(bpc, i, channel->enable, BERLIN_PWM_ENABLE);
265+
berlin_pwm_writel(bpc, i, channel->enable, BERLIN_PWM_EN);
266266
}
267267

268268
return 0;

0 commit comments

Comments
 (0)