• Andreas Kemnade's avatar
    power: supply: remove faulty cooling logic · c85c1916
    Andreas Kemnade authored
    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: e49a1e1e ("thermal/core: fix error code in __thermal_cooling_device_register()")
    Fixes: 952aeeb3 ("power_supply: Register power supply for thermal cooling device")
    Signed-off-by: default avatarAndreas Kemnade <andreas@kemnade.info>
    Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
    c85c1916
power_supply_core.c 40.5 KB