ACK: [PATCH 1/1] platform/x86: thinkpad_acpi: Fix multi-battery bug
Stefan Bader
stefan.bader at canonical.com
Wed Feb 27 15:44:40 UTC 2019
On 27.02.19 16:35, Kai-Heng Feng wrote:
> From: Thomas Weißschuh <linux at weissschuh.net>
>
> BugLink: https://bugs.launchpad.net/bugs/1812099
>
> The struct containing the supported operations for all batteries is
> being zeroed on each battery probe. This prevents all other batteries
> except the lastly probed one from being configured.
>
> Signed-off-by: Thomas Weißschuh <linux at weissschuh.net>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> (backported from commit d22296d9c38fd29a96bb5079fb8d17cee278f40e)
> Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index cae9b0595692..11ac3db7039a 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -9365,7 +9365,9 @@ static int tpacpi_battery_probe(int battery)
> {
> int ret = 0;
>
> - memset(&battery_info, 0, sizeof(struct tpacpi_battery_driver_data));
> + memset(&battery_info.batteries[battery], 0,
> + sizeof(battery_info.batteries[battery]));
> +
> /*
> * 1) Get the current start threshold
> * 2) Check for support
> @@ -9598,6 +9600,8 @@ static struct acpi_battery_hook battery_hook = {
>
> static int __init tpacpi_battery_init(struct ibm_init_struct *ibm)
> {
> + memset(&battery_info, 0, sizeof(battery_info));
> +
> battery_hook_register(&battery_hook);
> return 0;
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20190227/c89c586d/attachment-0001.sig>
More information about the kernel-team
mailing list