]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/x86: dell-ddv: Fix taking the psy->extensions_sem lock twice
authorArmin Wolf <W_Armin@gmx.de>
Fri, 27 Jun 2025 20:51:24 +0000 (22:51 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 7 Jul 2025 12:19:51 +0000 (15:19 +0300)
commitd4e83784b2a9be58b938d55efb232d2751c4cab4
treeabead8f9385135b274c7a0c9655baf6ca87a598c
parenta5f354232118751fe43be6ac896f8d6e7d7418b5
platform/x86: dell-ddv: Fix taking the psy->extensions_sem lock twice

Calling power_supply_get_property() inside
dell_wmi_ddv_battery_translate() can cause a deadlock since this
function is also being called from the power supply extension code,
in which case psy->extensions_sem is already being held.

Fix this by using the new power_supply_get_property_direct() function
to ignore any power supply extensions when retrieving the battery
serial number.

Tested on a Dell Inspiron 3505.

Reported-by: Hans de Goede <hansg@kernel.org>
Fixes: 058de163a376 ("platform/x86: dell-ddv: Implement the battery matching algorithm")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250627205124.250433-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/dell-wmi-ddv.c