linux/drivers/power/supply
Andreas Kemnade bc6405bca8 power: supply: remove faulty cooling logic
[ Upstream commit c85c191694 ]

The rn5t618 power driver fails to register
a cooling device because POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX
is missing but availability is not checked before registering
cooling device. After improved error checking in the thermal
code, the registration of the power supply fails entirely.

Checking for availability of _MAX before registering cooling device
fixes the rn5t618 problem. But the whole logic feels questionable.

First, the logic is inverted here:
the code tells: max_current = max_cooling but
0 = max_cooling, so there needs to be some inversion
in the code which cannot be found. Comparing with other
cooling devices, it can be found that value for fan speed is not
inverted, value for cpufreq cooling is inverted (similar situation
as here lowest frequency = max cooling)

Second, analyzing usage of _MAX: it is seems that maximum capabilities
of charging controller are specified and not of the battery. Probably
there is not too much mismatch in the drivers actually implementing
that. So nothing has exploded yet.  So there is no easy and safe way
to specifify a max cooling value now.

Conclusion for now (as a regression fix) just remove the cooling device
registration and do it properly later on.

Fixes: e49a1e1ee0 ("thermal/core: fix error code in __thermal_cooling_device_register()")
Fixes: 952aeeb3ee ("power_supply: Register power supply for thermal cooling device")
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-03-10 09:33:36 +01:00
..
88pm860x_battery.c
88pm860x_charger.c
ab8500_bmdata.c power: supply: ab8500: Standardize BTI resistance 2022-02-28 11:34:31 +01:00
ab8500_btemp.c power: supply: ab8500: Defer thermal zone probe 2022-11-01 01:00:32 +01:00
ab8500_chargalg.c power: supply: ab8500: remove unused static local variable 2022-10-05 23:47:04 +02:00
ab8500_charger.c power: supply: ab8500: Fix error handling in ab8500_charger_init() 2022-12-31 13:32:45 +01:00
ab8500_fg.c power supply and reset changes for the v6.0 series 2022-08-12 09:37:33 -07:00
ab8500-bm.h power: supply: ab8500: Standardize BTI resistance 2022-02-28 11:34:31 +01:00
ab8500-chargalg.h power: supply: ab8500: Drop external charger leftovers 2022-07-17 00:51:35 +02:00
acer_a500_battery.c
act8945a_charger.c
adp5061.c power: supply: adp5061: show unknown capacity_level as text 2022-09-11 12:19:28 +02:00
apm_power.c
axp20x_ac_power.c power: supply: axp20x_ac_power: fix platform_get_irq.cocci warning 2022-03-04 22:20:32 +01:00
axp20x_battery.c
axp20x_usb_power.c power: supply: axp20x_usb_power: fix platform_get_irq.cocci warnings 2022-03-04 22:20:32 +01:00
axp288_charger.c extcon: Fix extcon_get_extcon_dev() error handling 2022-05-13 17:03:40 +09:00
axp288_fuel_gauge.c power: supply: axp288_fuel_gauge: Drop BIOS version check from "T3 MRD" DMI quirk 2022-05-03 17:01:53 +02:00
bd99954-charger.c
bd99954-charger.h
bq27xxx_battery_hdq.c
bq27xxx_battery_i2c.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
bq27xxx_battery.c power: supply: bq27xxx: fix NULL vs 0 warnings 2022-09-11 15:04:59 +02:00
bq256xx_charger.c
bq2415x_charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
bq2515x_charger.c
bq24190_charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
bq24257_charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
bq24735-charger.c
bq25890_charger.c power: supply: bq25890: Ensure pump_express_work is cancelled on remove 2022-12-31 13:32:45 +01:00
bq25980_charger.c power: supply: bq25980: Implements POWER_SUPPLY_CHARGE_TYPE_BYPASS 2022-02-24 12:09:20 +01:00
bq25980_charger.h
charger-manager.c extcon: Fix extcon_get_extcon_dev() error handling 2022-05-13 17:03:40 +09:00
collie_battery.c
cpcap-battery.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE 2022-06-10 14:51:36 +02:00
cpcap-charger.c power: supply: cpcap-charger: fix repeated words in comments 2022-09-11 10:52:05 +02:00
cros_peripheral_charger.c power: supply: cros_peripheral: Use struct_size() helper in kzalloc() 2022-06-09 22:03:27 +02:00
cros_usbpd-charger.c
cw2015_battery.c power: supply: cw2015: Fix potential null-ptr-deref in cw_bat_probe() 2022-12-31 13:32:44 +01:00
da9030_battery.c
da9052-battery.c
da9150-charger.c
da9150-fg.c power: supply: da9150-fg: Remove unnecessary print function dev_err() 2022-03-04 22:20:33 +01:00
ds2760_battery.c
ds2780_battery.c
ds2781_battery.c
ds2782_battery.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
generic-adc-battery.c
goldfish_battery.c power: supply: Remove unnecessary print function dev_err() 2022-06-09 20:27:21 +02:00
gpio-charger.c
ingenic-battery.c
ip5xxx_power.c power: supply: ip5xxx: Fix integer overflow in current_now calculation 2022-11-01 00:02:36 +01:00
ipaq_micro_battery.c
isp1704_charger.c
Kconfig power supply and reset changes for the v6.1 series 2022-10-07 11:48:30 -07:00
lego_ev3_battery.c
lp8727_charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
lp8788-charger.c power: supply: lp8788: fix typo in comment 2022-06-09 20:02:56 +02:00
lt3651-charger.c
ltc2941-battery-gauge.c power: supply: ltc2941: clean up error messages 2022-02-13 22:21:42 +01:00
ltc4162-l-charger.c
Makefile power supply and reset changes for the v6.1 series 2022-10-07 11:48:30 -07:00
max1721x_battery.c power: supply: max1721x: Fix spelling mistake "Gauage" -> "Gauge" 2022-10-01 21:10:07 +02:00
max8903_charger.c
max8925_power.c
max8997_charger.c extcon: Fix extcon_get_extcon_dev() error handling 2022-05-13 17:03:40 +09:00
max8998_charger.c
max14577_charger.c
max14656_charger_detector.c power: supply: max14656: Use devm_work_autocancel() 2022-02-24 12:19:20 +01:00
max17040_battery.c
max17042_battery.c power: supply: max17042_battery: Use devm_work_autocancel() 2022-02-24 12:00:14 +01:00
max77650-charger.c
max77693_charger.c
max77976_charger.c power: supply: max77976: update Luca Ceresoli's e-mail address 2022-06-09 19:27:14 +02:00
mp2629_charger.c
mt6360_charger.c
mt6370-charger.c power: supply: mt6370: Fix return value check in mt6370_chg_probe() 2022-10-01 22:17:45 +02:00
olpc_battery.c power: supply: olpc_battery: Hold the reference returned by of_find_compatible_node 2022-07-17 01:05:54 +02:00
pcf50633-charger.c
pda_power.c
pmu_battery.c
power_supply_core.c power: supply: remove faulty cooling logic 2023-03-10 09:33:36 +01:00
power_supply_hwmon.c
power_supply_leds.c
power_supply_sysfs.c power: supply: Fix repeated word in comments 2022-09-11 14:11:53 +02:00
power_supply.h
qcom_smbb.c
rk817_charger.c power: supply: Fix refcount leak in rk817_charger_probe 2022-12-31 13:32:45 +01:00
rn5t618_power.c
rt5033_battery.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
rt9455_charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
rx51_battery.c
s3c_adc_battery.c
samsung-sdi-battery.c power: supply: samsung-sdi-battery: Add missing charge restart voltages 2022-04-13 12:05:22 +02:00
samsung-sdi-battery.h power: supply: Static data for Samsung batteries 2022-03-04 22:20:18 +01:00
sbs-battery.c
sbs-charger.c power: supply: sbs-charger: Don't cancel work that is not initialized 2022-02-24 12:16:21 +01:00
sbs-manager.c
sc27xx_fuel_gauge.c
sc2731_charger.c
smb347-charger.c i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
surface_battery.c power/supply: surface_battery: Use client device wrappers for notifier registration 2022-06-13 17:25:08 +02:00
surface_charger.c power/supply: surface_charger: Use client device wrappers for notifier registration 2022-06-13 17:25:08 +02:00
test_power.c
tosa_battery.c ARM/pxa/mfd/power/sound: Switch Tosa to GPIO descriptors 2022-05-07 22:55:33 +02:00
tps65090-charger.c
tps65217_charger.c power: supply: tps65217: Fix comments typo 2022-09-11 12:09:10 +02:00
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 power: supply: wm8350-power: Add missing free in free_charger_irq 2022-03-04 22:20:32 +01:00
z2_battery.c power: supply: z2_battery: Fix possible memleak in z2_batt_probe() 2022-12-31 13:32:44 +01:00