Re: [PATCH 2/2] platform/x86: thinkpad_acpi: Only check charge_start against a known charge_stop
From: Mark Pearson
Date: Wed Nov 25 2026 - 12:05:33 EST
On Wed, Nov 25, 2026, at 7:52 AM, Tom Hu wrote:
> Hi Rong, Mark,
>
> Thanks for the reviews.
>
> On 2026-11-24, Rong Zhang wrote:
>> A random thought: perhaps initializing charge_stop with 100 could make
>> the code cleaner?
> Good idea, Since charge_start is already limited to [0, 99] earlier in
> the
> store path, defaulting charge_stop to 100 when GET_STOP is not
> available makes
> the existing `value > charge_stop` check a no-op for such machines, and
> the extra
> stop_support condition is not needed.
>
> The v2 I'm about to send.
>
>
> On 2026-11-24, Mark Pearson wrote:
>> Have you seen this happen on any actual HW?
> Not on hardware I have access to; I agree a firmware exposing
> GET_START but not GET_STOP
> is unusual, so the patch is mostly hardening, but the current behaviour
> (rejecting every charge_start > 0)
> is wrong either way, so I think it is worth fixing.
>
Yep - just wanted to check. I'd go and ask the FW to be fixed if it was being seen on real HW ;)
Mark