diff options
author | Hans de Goede <hdegoede@redhat.com> | 2024-12-15 18:21:24 +0100 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2024-12-20 00:36:05 +0100 |
commit | 04d9741493e7a1d17d2109f4c9ea21f3314666b4 (patch) | |
tree | 4feba54e728726511388457e9a29727c117ef318 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 21096800c5ac634a9fbbac21505bfd798163b390 (diff) |
power: supply: Use power_supply_external_power_changed() in __power_supply_changed_work()
The power-supply core is designed so that power-supply driver callbacks
such as get_property() and external_power_changed() will not be called
until the power-supply's parent driver's probe() function has completed.
There is a race where power_supply_changed() can be called for a supplier
of a power-supply which is being probed after the device_add() in
__power_supply_register() but before the parent driver's probe() function
has completed. Hitting this race breaks the power-supply core's design
to not call power-supply driver callbacks before probe() completion.
This problem is caused by __power_supply_changed_work() calling
the external_power_changed() directly rather then going through
the power_supply_external_power_changed() helper which correcly checks
psy->use_cnt .
Switch to using power_supply_external_power_changed() to fix this race.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20241215172133.178460-2-hdegoede@redhat.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions