Re: [PATCH] power: supply: cros_charge-control: restore EC state on resume

From: Andrew Pam

Date: Mon Oct 05 2026 - 00:45:35 EST


On Mon, 5 Oct 2026, at 15:20, Tzung-Bi Shih wrote:
> On Mon, Oct 05, 2026 at 09:56:06AM +1100, Andrew Pam wrote:
> > Nothing notices the reset. Commit 4fc88ba435da ("power: supply:
> > cros_charge-control: adopt EC charge state on probe") made the driver
>
> The commit 4fc88ba435da doesn't exist.

Thanks for the review. The patch is against Sebastian's power-supply for-next, where that is Matt's patch you reviewed, applied on 10 September:

https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git/commit/?id=4fc88ba435da

It isn't in mainline or chrome-platform yet, so I have made that explicit in the v2 commit message.

> > initialise its cached state from the EC, but it does so only on probe,
> ^^^^
> To be precise, this should be "to".

Reworded in v2 as "made the driver adopt the EC's charge state, but only at probe".

I have also taken your other three suggestions: dev_set_drvdata(), a dev_err() when reprogramming fails, and the nested .driver initialiser. v2 also fixes the resume hook's comment, which still said the driver never reads the state back from the EC. That hasn't been true since 4fc88ba435da. And v2 adds Fixes: and Cc: stable: the driver has had no resume handling since it was added in 6.11, so stable kernels lose the charge limit across hibernation too. v2 follows shortly.

Thanks,
Andrew