linux-yocto/drivers/power/supply
Jerry Lv 558ba4afdf power: supply: bq27xxx: Retrieve again when busy
[ Upstream commit f16d9fb6cf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-27 11:08:52 +01:00
..
88pm860x_battery.c
88pm860x_charger.c
ab8500_bmdata.c
ab8500_btemp.c
ab8500_chargalg.c
ab8500_charger.c
ab8500_fg.c
ab8500-bm.h
ab8500-chargalg.h
acer_a500_battery.c
act8945a_charger.c
adp5061.c
apm_power.c
axp20x_ac_power.c
axp20x_battery.c power: supply: axp20x_battery: Remove design from min and max voltage 2024-10-04 16:29:06 +02:00
axp20x_usb_power.c
axp288_charger.c power: supply: axp288_charger: Round constant_charge_voltage writes down 2024-08-14 13:58:58 +02:00
axp288_fuel_gauge.c
bd99954-charger.c
bd99954-charger.h
bq27xxx_battery_hdq.c
bq27xxx_battery_i2c.c power: supply: bq27xxx: Retrieve again when busy 2025-06-27 11:08:52 +01:00
bq27xxx_battery.c power: supply: bq27xxx: Retrieve again when busy 2025-06-27 11:08:52 +01:00
bq256xx_charger.c
bq2415x_charger.c
bq2515x_charger.c
bq24190_charger.c
bq24257_charger.c
bq24735-charger.c
bq25890_charger.c
bq25980_charger.c
bq25980_charger.h
charger-manager.c
collie_battery.c power: supply: collie: Fix wakeup source leaks on device unbind 2025-06-27 11:08:51 +01:00
cpcap-battery.c
cpcap-charger.c
cros_peripheral_charger.c
cros_usbpd-charger.c power: supply: cros_usbpd: provide ID table for avoiding fallback match 2024-06-27 13:49:03 +02:00
cw2015_battery.c
da9030_battery.c
da9052-battery.c
da9150-charger.c
da9150-fg.c power: supply: da9150-fg: fix potential overflow 2025-02-27 04:10:50 -08:00
ds2760_battery.c
ds2780_battery.c
ds2781_battery.c
ds2782_battery.c
generic-adc-battery.c
goldfish_battery.c
gpio-charger.c power: supply: gpio-charger: Fix set charge current limits 2025-01-02 10:32:10 +01:00
ingenic-battery.c
ip5xxx_power.c
ipaq_micro_battery.c
isp1704_charger.c
Kconfig
lego_ev3_battery.c
lp8727_charger.c
lp8788-charger.c
lt3651-charger.c
ltc2941-battery-gauge.c
ltc4162-l-charger.c
Makefile
max1721x_battery.c
max8903_charger.c
max8925_power.c
max8997_charger.c
max8998_charger.c
max14577_charger.c
max14656_charger_detector.c
max17040_battery.c
max17042_battery.c power: supply: max17042_battery: Fix SOC threshold calc w/ no current sense 2024-10-04 16:29:06 +02:00
max77650-charger.c
max77693_charger.c power: supply: max77693: Fix wrong conversion of charge input threshold value 2025-04-10 14:37:31 +02:00
max77976_charger.c
mp2629_charger.c
mt6360_charger.c
mt6370-charger.c
olpc_battery.c
pcf50633-charger.c
pmu_battery.c
power_supply_core.c power: supply: core: Remove might_sleep() from power_supply_put() 2024-12-09 10:32:31 +01:00
power_supply_hwmon.c power: supply: hwmon: Fix missing temp1_max_alarm attribute 2024-10-10 11:57:45 +02:00
power_supply_leds.c
power_supply_sysfs.c
power_supply.h
qcom_battmgr.c soc: qcom: pmic_glink: Fix race during initialization 2024-09-04 13:28:28 +02:00
qcom_pmi8998_charger.c
qcom_smbb.c
rk817_charger.c
rn5t618_power.c
rt5033_battery.c
rt5033_charger.c
rt9455_charger.c
rt9467-charger.c
rt9471.c power: supply: rt9471: Use IC status regfield to report real charger status 2024-12-09 10:32:32 +01:00
rx51_battery.c
samsung-sdi-battery.c
samsung-sdi-battery.h
sbs-battery.c
sbs-charger.c
sbs-manager.c
sc27xx_fuel_gauge.c
sc2731_charger.c
smb347-charger.c
surface_battery.c
surface_charger.c
test_power.c
tps65090-charger.c
tps65217_charger.c
twl4030_charger.c
twl4030_madc_battery.c
ucs1002_power.c
ug3105_battery.c
wilco-charger.c
wm97xx_battery.c
wm831x_backup.c
wm831x_power.c
wm8350_power.c