• Krzysztof Kozlowski's avatar
    power_supply: Add no_thermal property to prevent recursive get_temp calls · a69d82b9
    Krzysztof Kozlowski authored
    Add a 'no_thermal' property to the power supply class. If true then
    thermal zone won't be created for this power supply in
    power_supply_register().
    
    Power supply drivers may want to set it if they support
    POWER_SUPPLY_PROP_TEMP and they are forwarding this get property call to
    other thermal zone.
    
    If they won't set it lockdep may report false positive deadlock for
    thermal zone's mutex because of nested calls to thermal_zone_get_temp().
    First is the call to thermal_zone_get_temp() of the driver's thermal
    zone. Thermal core gets POWER_SUPPLY_PROP_TEMP property from this
    driver. The driver then calls other thermal zone thermal_zone_get_temp()
    and returns result.
    
    Example of such driver is charger manager.
    Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
    Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
    a69d82b9
power_supply.h 9.87 KB