* [PATCH v2] pwm: berlin: Fix wrong register in suspend/resume
@ 2025-08-19 11:42 Jisheng Zhang
2025-08-20 11:05 ` Uwe Kleine-König
0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2025-08-19 11:42 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: linux-pwm, linux-kernel
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>
---
since v1:
- update commit log to mention cpu exception then kernel panic w/o
the patch
drivers/pwm/pwm-berlin.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/pwm-berlin.c b/drivers/pwm/pwm-berlin.c
index 831aed228caf..858d36991374 100644
--- a/drivers/pwm/pwm-berlin.c
+++ b/drivers/pwm/pwm-berlin.c
@@ -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;
--
2.50.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] pwm: berlin: Fix wrong register in suspend/resume
2025-08-19 11:42 [PATCH v2] pwm: berlin: Fix wrong register in suspend/resume Jisheng Zhang
@ 2025-08-20 11:05 ` Uwe Kleine-König
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König @ 2025-08-20 11:05 UTC (permalink / raw)
To: Jisheng Zhang; +Cc: linux-pwm, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 929 bytes --]
Hello,
On Tue, Aug 19, 2025 at 07:42:24PM +0800, Jisheng Zhang wrote:
> 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>
> ---
> since v1:
> - update commit log to mention cpu exception then kernel panic w/o
> the patch
Applied this patch to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/fixes
with a Cc: stable now. Given this issue is nearly 9 years old I'm not
sure yet this fix is urgent enough to justify a fixes PR to Linus.
However there are two such patches now, so maybe I will prepare another
pull request before 6.17. But for now I will give it a few days in next
first.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-20 11:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 11:42 [PATCH v2] pwm: berlin: Fix wrong register in suspend/resume Jisheng Zhang
2025-08-20 11:05 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox