Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: berlin: Fix wrong register in suspend/resume

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>

authored by

Jisheng Zhang and committed by
Uwe Kleine-König
3a4b9d02 75604e9a

+2 -2
+2 -2
drivers/pwm/pwm-berlin.c
··· 234 234 for (i = 0; i < chip->npwm; i++) { 235 235 struct berlin_pwm_channel *channel = &bpc->channel[i]; 236 236 237 - channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_ENABLE); 237 + channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_EN); 238 238 channel->ctrl = berlin_pwm_readl(bpc, i, BERLIN_PWM_CONTROL); 239 239 channel->duty = berlin_pwm_readl(bpc, i, BERLIN_PWM_DUTY); 240 240 channel->tcnt = berlin_pwm_readl(bpc, i, BERLIN_PWM_TCNT); ··· 262 262 berlin_pwm_writel(bpc, i, channel->ctrl, BERLIN_PWM_CONTROL); 263 263 berlin_pwm_writel(bpc, i, channel->duty, BERLIN_PWM_DUTY); 264 264 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); 266 266 } 267 267 268 268 return 0;