]> Pileus Git - ~andy/linux/blobdiff - drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
iwlwifi: check RF kill register when interrupts have been disabled
[~andy/linux] / drivers / net / wireless / iwlwifi / iwl-trans-pcie.c
index 589037d6e397945a9ecabd9dadd05a1884554806..8e1cf97dfad2ad18f3c187eaf06d843f4c14008e 100644 (file)
@@ -1438,12 +1438,22 @@ error:
 
 static void iwl_trans_pcie_stop_hw(struct iwl_trans *trans)
 {
+       bool hw_rfkill;
+
        iwl_apm_stop(trans);
 
        iwl_write32(trans, CSR_INT, 0xFFFFFFFF);
 
        /* Even if we stop the HW, we still want the RF kill interrupt */
        iwl_enable_rfkill_int(trans);
+
+       /*
+        * Check again since the RF kill state may have changed while all the
+        * interrupts were disabled, in this case we couldn't receive the
+        * RF kill interrupt and update the state in the op_mode.
+        */
+       hw_rfkill = iwl_is_rfkill_set(trans);
+       iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
 }
 
 static void iwl_trans_pcie_reclaim(struct iwl_trans *trans, int txq_id, int ssn,