• Vadim Pasternak's avatar
    mlxsw: core: Add the hottest thermal zone detection · 6f73862f
    Vadim Pasternak authored
    When multiple sensors are mapped to the same cooling device, the
    cooling device should be set according the worst sensor from the
    sensors associated with this cooling device.
    
    Provide the hottest thermal zone detection and enforce cooling device
    to follow the temperature trends of the hottest zone only.
    Prevent competition for the cooling device control from others zones,
    by "stable trend" indication. A cooling device will not perform any
    actions associated with a zone with a "stable trend".
    
    When other thermal zone is detected as a hottest, a cooling device is
    to be switched to following temperature trends of new hottest zone.
    
    Thermal zone score is represented by 32 bits unsigned integer and
    calculated according to the next formula:
    For T < TZ<t><i>, where t from {normal trip = 0, high trip = 1, hot
    trip = 2, critical = 3}:
    TZ<i> score = (T + (TZ<t><i> - T) / 2) / (TZ<t><i> - T) * 256 ** j;
    Highest thermal zone score s is set as MAX(TZ<i>score);
    Following this formula, if TZ<i> is in trip point higher than TZ<k>,
    the higher score is to be always assigned to TZ<i>.
    
    For two thermal zones located at the same kind of trip point, the higher
    score will be assigned to the zone which is closer to the next trip
    point. Thus, the highest score will always be assigned objectively to
    the hottest thermal zone.
    
    All the thermal zones initially are to be configured with mode
    "enabled" with the "step_wise" governor.
    Signed-off-by: default avatarVadim Pasternak <vadimp@mellanox.com>
    Acked-by: default avatarJiri Pirko <jiri@mellanox.com>
    Signed-off-by: default avatarIdo Schimmel <idosch@mellanox.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6f73862f
core_thermal.c 29 KB