• Johannes Berg's avatar
    iwlwifi: pcie: fix another RF-kill race · 23aeea94
    Johannes Berg authored
    When resuming, it's possible for the following scenario to occur:
    
     * iwl_pci_resume() enables the RF-kill interrupt
     * iwl_pci_resume() reads the RF-kill state (e.g. to 'radio enabled')
     * RF_KILL interrupt triggers, and iwl_pcie_irq_handler() reads the
       state, now 'radio disabled', and acquires the &trans_pcie->mutex.
     * iwl_pcie_irq_handler() further calls iwl_trans_pcie_rf_kill() to
       indicate to the higher layers that the radio is now disabled (and
       stops the device while at it)
     * iwl_pcie_irq_handler() drops the mutex
     * iwl_pci_resume() continues, acquires the mutex and calls the higher
       layers to indicate that the radio is enabled.
    
    At this point, the device is stopped but the higher layers think it's
    available, and can call deeply into the driver to try to enable it.
    However, this will fail since the device is actually disabled.
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
    23aeea94
rx.c 58.6 KB