linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Milan P. Stanić" <mps@arvanta.net>
To: Vicente Bergas <vicencb@gmail.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>,
	Sebastian Reichel <sre@kernel.org>,
	linux-pm@vger.kernel.org, kernel@collabora.com,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>
Subject: Re: [PATCH] power: supply: sbs-battery: chromebook workaround for PEC
Date: Mon, 5 Oct 2020 22:33:49 +0200	[thread overview]
Message-ID: <20201005203349.GA23644@arya.arvanta.net> (raw)
In-Reply-To: <20201005184759.GA15677@arya.arvanta.net>

On Mon, 2020-10-05 at 20:48, Milan P. Stanić wrote:
> Hi all,
> 
> On Mon, 2020-10-05 at 19:53, Vicente Bergas wrote:
> > On Monday, October 5, 2020 12:46:01 AM CEST, Sebastian Reichel wrote:
> > > Looks like the I2C tunnel implementation from Chromebook's
> > > embedded controller does not handle PEC correctly. Fix this
> > > by disabling PEC for batteries behind those I2C tunnels as
> > > a workaround.
> > > 
> > > Reported-by: "Milan P. Stanić" <mps@arvanta.net>
> > > Reported-by: Vicente Bergas <vicencb@gmail.com>
> > > CC: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > Fixes: 7222bd603dd2 ("power: supply: sbs-battery: add PEC support")
> > > Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> > > ---
> > > Hi,
> > > 
> > > This is compile-tested only, since I do not have a chromebook at
> > > hand. Please test if this fixes your issue.
> > 
> > Hi Sebastian,
> > tested on rk3399-gru-kevin with 5.9.0-rc8 and now the CPU usage is 0 when
> > idling.
> > dmesg reports:
> > [    1.370249] sbs-battery 9-000b: Disabling PEC because of broken Cros-EC
> > implementation
> 
> Also I tested on same board and same kernel version and can confirm
> this.

And I forgot to mention that I opened bug report. sorry.
https://bugzilla.kernel.org/show_bug.cgi?id=209409
  
> > So,
> > Tested-by: Vicente Bergas <vicencb@gmail.com>
> > 
> > Thanks,
> >  Vicente.
> > 
> > > -- Sebastian
> > > ---
> > >  drivers/power/supply/sbs-battery.c | 6 ++++++
> > >  1 file changed, 6 insertions(+)
> > > 
> > > diff --git a/drivers/power/supply/sbs-battery.c
> > > b/drivers/power/supply/sbs-battery.c
> > > index 13192cbcce71..b6a538ebb378 100644
> > > --- a/drivers/power/supply/sbs-battery.c
> > > +++ b/drivers/power/supply/sbs-battery.c
> > > @@ -279,6 +279,12 @@ static int sbs_update_presence(struct sbs_info
> > > *chip, bool is_present)
> > >  	else
> > >  		client->flags &= ~I2C_CLIENT_PEC;
> > >   +	if (of_device_is_compatible(client->dev.parent->of_node,
> > > "google,cros-ec-i2c-tunnel")
> > > +	    && client->flags & I2C_CLIENT_PEC) {
> > > +		dev_info(&client->dev, "Disabling PEC because of broken Cros-EC
> > > implementation\n");
> > > +		client->flags &= ~I2C_CLIENT_PEC;
> > > +	}
> > > +
> > >  	dev_dbg(&client->dev, "PEC: %s\n", (client->flags & I2C_CLIENT_PEC) ?
> > >  		"enabled" : "disabled");
> > 

  reply	other threads:[~2020-10-05 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-04 22:46 [PATCH] power: supply: sbs-battery: chromebook workaround for PEC Sebastian Reichel
2020-10-05 17:53 ` Vicente Bergas
2020-10-05 18:47   ` Milan P. Stanić
2020-10-05 20:33     ` Milan P. Stanić [this message]
2020-10-08 19:07 ` Milan P. Stanić
2020-10-10 11:09   ` Sebastian Reichel

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=20201005203349.GA23644@arya.arvanta.net \
    --to=mps@arvanta.net \
    --cc=enric.balletbo@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=sre@kernel.org \
    --cc=vicencb@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).