diff options
| author | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-10-18 00:35:12 +0200 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-10-18 00:35:12 +0200 |
| commit | 6a559552107ab6b470af0cb5e6aab3aad17c19cc (patch) | |
| tree | 860bbe16a37b30a0a7bc0f2de488bd763331dcf6 /include/linux | |
| parent | 9c034b714ff97bbb0b9b9946857f7244db11eea0 (diff) | |
| parent | 5b4bd13e0552926648a46c2c9a12a24dfaee3715 (diff) | |
| download | linux-6a559552107ab6b470af0cb5e6aab3aad17c19cc.tar.gz linux-6a559552107ab6b470af0cb5e6aab3aad17c19cc.zip | |
Merge power-supply fixes branch
Merge power-supply fixes branch to extend the epc_sem unregister fix
contained in it from external_power_changed to also cover get/set
property.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/power_supply.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index f6cbeffda653..cce61137aef4 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -363,6 +363,16 @@ struct power_supply { bool removing; atomic_t use_cnt; struct power_supply_battery_info *battery_info; + /* + * Held for read while ->external_power_changed() runs, and for write by + * power_supply_unregister() when it publishes @removing, so that it + * waits for an in-flight callback to finish. Without this a driver's + * data, typically devm-allocated on its own device, can be freed while + * the callback is still using it. + * Must not be shared with extensions_sem: callbacks may read their own + * properties, which takes that one for read. + */ + struct rw_semaphore epc_sem; struct rw_semaphore extensions_sem; /* protects "extensions" */ struct list_head extensions; #ifdef CONFIG_THERMAL @@ -426,9 +436,9 @@ struct power_supply_vbat_ri_table { * @charge_voltage_max_uv: maintenance charging voltage that is usually a bit * lower than the constant_charge_voltage_max_uv. We can apply this settings * charge_current_max_ua until we get back up to this voltage. - * @safety_timer_minutes: maintenance charging safety timer, with an expiry - * time in minutes. We will only use maintenance charging in this setting - * for a certain amount of time, then we will first move to the next + * @charge_safety_timer_minutes: maintenance charging safety timer, with an + * expiry time in minutes. We will only use maintenance charging in this + * setting for a certain amount of time, then we will first move to the next * maintenance charge current and voltage pair in respective array and wait * for the next safety timer timeout, or, if we reached the last maintencance * charging setting, disable charging until we reach |
