[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250923161354.1307251-1-luogf2025@163.com>
Date: Wed, 24 Sep 2025 00:13:54 +0800
From: GuangFei Luo <luogf2025@....com>
To: rafael@...nel.org
Cc: michal.wilczynski@...el.com,
dan.carpenter@...aro.org,
lenb@...nel.org,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org,
lkp@...el.com,
sre@...nel.org,
stable@...r.kernel.org
Subject: Re:[PATCH v6] ACPI: battery: prevent sysfs_add_battery re-entry on rapid events
The functions battery_hook_add_battery(), battery_hook_remove_battery(),
and sysfs_remove_battery() already acquire locks, so their internal
accesses are safe.
acpi_battery_refresh() does check battery->bat, but its child
functions (sysfs_add_battery() and sysfs_remove_battery()) already
handle locking.
In acpi_battery_notify(), battery->bat has no lock. However, the
check of battery->bat is at the very end of the function. During
earlier calls, battery->bat has already been protected by locks, so
re-entry will not cause issues.
Powered by blists - more mailing lists