public inbox for linux-pwm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: "Uwe Kleine-König" <ukleinek@kernel.org>
Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pwm: berlin: Fix wrong register in suspend/resume
Date: Mon, 18 Aug 2025 20:09:33 +0800	[thread overview]
Message-ID: <aKMX_c3gvYc6E3DT@xhacker> (raw)
In-Reply-To: <rscqtwztqwtihcq7rwvyjvnkbo5bmve257i66e3it52cnft7pb@6gwbgx5o7lpt>

On Sun, Aug 17, 2025 at 12:52:01PM +0200, Uwe Kleine-König wrote:
> Hello,

Hi,

> 
> On Fri, Aug 15, 2025 at 11:10:16AM +0800, Jisheng Zhang wrote:
> > The 'enable' register should be BERLIN_PWM_EN rather than
> > BERLIN_PWM_ENABLE.
> > 
> > Fixes: bbf0722c1c66 ("pwm: berlin: Add suspend/resume support")
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> >  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);
> 
> BERLIN_PWM_ENABLE is 1 and BERLIN_PWM_EN is 0. What is the effect? Is
> the low bit just ignored and the right thing happens? Or does this

operate the wrong address then kernel panic

> result in a bus exception and the machine catches fire?

Yep, cpu exception then kernel panic.

> 
> If it's more the latter than the former, I wonder how that didn't pop up
> earlier.

This bug has been fixed in vendor's repo for a long time, it's just
because we didn't upstream the fix.

Thanks

  reply	other threads:[~2025-08-18 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15  3:10 [PATCH] pwm: berlin: Fix wrong register in suspend/resume Jisheng Zhang
2025-08-17 10:52 ` Uwe Kleine-König
2025-08-18 12:09   ` Jisheng Zhang [this message]
2025-08-19  6:15     ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aKMX_c3gvYc6E3DT@xhacker \
    --to=jszhang@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=ukleinek@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox