summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/gecko.py
diff options
context:
space:
mode:
authorJerry Lv <Jerry.Lv@axis.com>2025-04-15 11:40:47 +0800
committerSebastian Reichel <sebastian.reichel@collabora.com>2025-04-28 00:24:52 +0200
commitf16d9fb6cf03fdbdefa41a8b32ba1e57afb7ae3d (patch)
treeb60d1fc02babaa9121552e42fda1cf1db24eff4a /tools/perf/scripts/python/gecko.py
parent1e3e2cf2df60521eee257b2c77a8f0d8594242ff (diff)
power: supply: bq27xxx: Retrieve again when busy
Multiple applications may access the battery gauge at the same time, so the gauge may be busy and EBUSY will be returned. The driver will set a flag to record the EBUSY state, and this flag will be kept until the next periodic update. When this flag is set, bq27xxx_battery_get_property() will just return ENODEV until the flag is updated. Even if the gauge was busy during the last accessing attempt, returning ENODEV is not ideal, and can cause confusion in the applications layer. Instead, retry accessing the I2C to update the flag is as expected, for the gauge typically recovers from busy state within a few milliseconds. If still failed to access the gauge, the real error code would be returned instead of ENODEV (as suggested by Pali Rohár). Reviewed-by: Pali Rohár <pali@kernel.org> Signed-off-by: Jerry Lv <Jerry.Lv@axis.com> Link: https://lore.kernel.org/r/20250415-foo-fix-v2-1-5b45a395e4cc@axis.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/gecko.py')
0 files changed, 0 insertions, 0 deletions