NACK: [PATCH 1/1] platform/x86: thinkpad_acpi: Fix multi-battery bug

Kai-Heng Feng kai.heng.feng at canonical.com
Wed Feb 27 15:34:13 UTC 2019



> On Feb 27, 2019, at 23:21, Stefan Bader <stefan.bader at canonical.com> wrote:
> 
> On 27.02.19 15:23, Kai-Heng Feng wrote:
>> From: Thomas Weißschuh <linux at weissschuh.net>
>> 
> 
> Missing BugLink

Will send a V2.

> 
>> 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>
>> ---
>> 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;
>> }
>> 
> 
> 
> -- 
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team




More information about the kernel-team mailing list