mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rong Zhang <i@rong.moe>
To: "Derek J. Clark" <derekjohn.clark@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Ike Panhc <ikepanhc@gmail.com>,
	Mark Pearson <mpearson-lenovo@squebb.ca>,
	 Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,  stable@vger.kernel.org
Subject: Re: [PATCH 0/2] platform/x86: ideapad-laptop: Fix unexpected charge_types on probe
Date: Thu, 19 Nov 2026 23:32:03 +0800	[thread overview]
Message-ID: <812366f4131b1e92b80c2f216d1ef7400400e9bc.camel@rong.moe> (raw)
In-Reply-To: <C49666E5-E76A-42E9-8CEA-6195D066A02B@gmail.com>

Hi Derek, Ilpo,

Whoops, I somehow forgot to reply to this. Sorry >.<

On Sun, 2026-10-18 at 18:17 -0700, Derek J. Clark wrote:
> On October 18, 2026 7:19:33 AM PDT, Rong Zhang <i@rong.moe> wrote:
> > Hi Derek,
> > 
> > Thanks for you information.
> > 
> > On Sat, 2026-10-17 at 22:30 -0700, Derek J. Clark wrote:
> > > On October 17, 2026 4:16:17 PM PDT, Rong Zhang <i@rong.moe> wrote:
> > > > It was reported [1] that some unfortunate combinations of BIOS and
> > > > Lenovo utilities (e.g., Legion Go 2 + Legion Space) may enable Rapid
> > > > Charge and Conservation Mode at the same time, which is very out of
> > > > sepc.
> > > > 
> > > > If both are enabled during a previous Windows boot, ideapad-laptop will
> > > > see both bits set and correctly shout "unexpected charge_types".
> > > > 
> > > > A planned BIOS update will address this. Before that, if unexpected
> > > > charge_types are encountered on probe, enforce [Long_Life] to prevent
> > > > the device from operating in an out-of-spec state. On check or fix
> > > > failure, skip registering the battery hook and the conservation_mode
> > > > attribute.
> > > > 
> > > > Note: the switches never enable themselves autonomously, so there is no
> > > > need to fix it during runtime.
> > > > 
> > > 
> > > Hi Rong,
> > > 
> > > Note that this isn't strictly true. A known bug in multiple Lenovo devices is that querying the EC too quickly can cause it to reset into an invalid state. I.e. some games run under wine for check the state of the AC adapter multiple times a second. In such a case they can reset and then report both modes on. 
> > > 
> > 
> > Could you confirm if it's a completely different issue compared to
> > https://msgid.link/58586fa666f09c209f9d7fe8c692a8bdda6d4410.camel@rong.moe
> > (i.e., an ACPI mutex ABBA deadlock cause the GBMD method to return
> > garbage data)?
> > 
> 
> I believe it is. The invalid state survives a power cycle and is preceded by a process hanging for a few seconds before the EC resets. It can be reproduced repeatedly by a simple bash loop that reads the state multiple times a second.

If this is the case, I don't think it's safe to fix the invalid state
whenever seen.

> 
> - Derek 
> > 
> > [...]
> > 
> > > 
> > > Lenovo ha mentioned to me a BIOS fix for this issue will be coming for the Go S and Go 2 at some point as well, but this isn't exclusive to Go models. It may be prudent to fix any time an invalid state is detected.

Frequent read attempts may have pushed the EC to the edge of the cliff.
If we fix the invalid state immediately whenever we find it during
handling the said read attempts, we may push the EC further off the
cliff.

> > 
> > I am OK with the fix-whenever-seen approach, but in this manner it'd be
> > better to wait until
> > https://msgid.link/20261018122348.679126-1-aliamemis@disroot.org is
> > applied to solve the ABBA deadlock issue, so that false positives during
> > runtime are reduced.

This series has entered 7.4. Let's see if it helps, as it should also
reduce the stress on the EC.

If it doesn't help, I believe the correct approach to work around the
broken firmware is to prevent stressing the GBMD/SBMC methods to much. I
will prepare another patch for this if the feedback indicates the need
for a workaround.

Ilpo, I noticed that you've applied this. Thanks for that. I think there
is no need to drop the series unless Derek is opposed to it. Further
workarounds (if any) can go on top of it.

Thanks,
Rong

> > 
> > Thanks,
> > Rong
> > 
> > > 
> > > Thanks,
> > > - Derek
> > > 
> > > [1] https://github.com/torvalds/linux/blob/32c52ec87d6245ee2d12ed5dd509e40062939b50/drivers/platform/x86/lenovo/ideapad-laptop.c#L286-L296
> > > 
> > > > Fixes: 90430ea98f55 ("platform/x86: ideapad-laptop: Add charge_types:Fast (Rapid Charge)")
> > > > Closes: https://github.com/ValveSoftware/SteamOS/issues/2876 [1]
> > > > Signed-off-by: Rong Zhang <i@rong.moe>
> > > > ---
> > > > Rong Zhang (2):
> > > >      platform/x86: ideapad-laptop: Factor out charge_types methods for internal use
> > > >      platform/x86: ideapad-laptop: Fix unexpected charge_types on probe
> > > > 
> > > > drivers/platform/x86/lenovo/ideapad-laptop.c | 113 ++++++++++++++++++++-------
> > > > 1 file changed, 84 insertions(+), 29 deletions(-)
> > > > ---
> > > > base-commit: 58161ead29e50d70a317ea26b472e0c7508e69da
> > > > change-id: ef28eda4-ideapad-fix-charge-types-067d46d08945
> > > > 
> > > > Thanks,
> > > > Rong
> > > > 

  reply	other threads:[~2026-11-19 15:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 23:16 Rong Zhang
2026-10-17 23:16 ` [PATCH 1/2] platform/x86: ideapad-laptop: Factor out charge_types methods for internal use Rong Zhang
2026-10-17 23:16 ` [PATCH 2/2] platform/x86: ideapad-laptop: Fix unexpected charge_types on probe Rong Zhang
2026-10-18  5:30 ` [PATCH 0/2] " Derek J. Clark
2026-10-18 14:19   ` Rong Zhang
2026-10-19  1:17     ` Derek J. Clark
2026-11-19 15:32       ` Rong Zhang [this message]
2026-11-19 14:42 ` Ilpo Järvinen

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=812366f4131b1e92b80c2f216d1ef7400400e9bc.camel@rong.moe \
    --to=i@rong.moe \
    --cc=derekjohn.clark@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ikepanhc@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.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

all inboxes | Powered by JetHome®