]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / battery: Safe unregistering of hooks
authorJouke Witteveen <j.witteveen@gmail.com>
Wed, 4 Jul 2018 10:27:15 +0000 (12:27 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 Jul 2018 10:36:29 +0000 (12:36 +0200)
commitafe767d5572e8976bccad24661280a86fe94dc8d
tree2ca1fcd964c3a1b8038840b4a009d5178ba36e9c
parentbd594001da828129ed149628b7cd368061398a51
ACPI / battery: Safe unregistering of hooks

A hooking API was implemented for 4.17 in 834530b64262889f followed
by hooks for Thinkpad laptops in dcd9abe2d03dc0fe. The Thinkpad
drivers did not support the Thinkpad 13 and the hooking API crashes
on unsupported batteries by altering a list of hooks during unsafe
iteration. Thus, Thinkpad 13 laptops could no longer boot.

Additionally, a lock was kept in place and debugging information was
printed out of order.

Fixes: 834530b64262 (battery: Add the battery hooking API)
Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
Signed-off-by: Jouke Witteveen <j.witteveen@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c