Skip to content
  • Wey-Yi Guy's avatar
    iwlwifi: reliable entering of critical temperature state · 7812b167
    Wey-Yi Guy authored
    
    
    When uCode detects critical temperature it should send "card state
    notification" interrupt to driver and then shut itself down to prevent
    overheating. There is a race condition where uCode shuts down before it
    can deliver the interrupt to driver.
    Additional method provided here for driver to enter CT_KILL state based
    on temperature reading.
    
    How it works:
    Method 1:
    If driver receive "card state notification" interrupt from uCode; it
    enters "CT_KILL" state immediately
    
    Method 2:
    If the last temperature report by Card reach Critical temperature,
    driver will send "statistic notification" request to uCode to verify the
    temperature reading, if driver can not get reply from uCode within
    300ms, driver will enter CT_KILL state automatically.
    
    Method 3:
    If the last temperature report by Card did not reach Critical
    temperature, but uCode already shut down due to critical temperature.
    All the host commands send to uCode will not get process by uCode;
    when command queue reach the limit, driver will check the last reported
    temperature reading, if it is within pre-defined margin, enter "CT_KILL"
    state immediately. In this case, when uCode ready to exit from "CT_KILL" state,
    driver need to restart the adapter in order to reset all the queues and
    resume normal operation.
    
    One additional issue being address here, when system is in CT_KILL
    state, both tx and rx already stopped, but driver still can send host
    command to uCode, it will flood the command queue since card was not
    responding; adding STATUS_CT_KILL flag to reject enqueue host commands
    to uCode if it is in CT_KILL state, when uCode is ready to come out of
    CT_KILL, driver will clear  the STATUS_CT_KILL bit and allow enqueue the host
    commands to uCode to recover from CT_KILL state.
    
    Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
    Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    7812b167