]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iwlwifi: pcie: enable interrupts before releasing the NIC's CPU
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 8 Jun 2016 20:07:31 +0000 (23:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:10:53 +0000 (18:10 +0200)
commit 2aabdbdc17b7c53490337bfc58de3409c84d85d2 upstream.

The NIC's CPU gets started after the firmware has been
written to its memory. The first thing it does is to
send an interrupt to let the driver know that it is
running. In order to get that interrupt, the driver needs
to make sure it is not masked. Of course, the interrupt
needs to be enabled in the driver before the CPU starts to
run.
I mistakenly inversed those two steps leading to races
which prevented the driver from getting the alive interrupt
from the firmware.
Fix that.

Fixes: a6bd005fe92 ("iwlwifi: pcie: fix RF-Kill vs. firmware load race")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index f603d7830a6b219d49d3615b656d16d9cd2ef7dd..e9a153f68452a114f2402bb8241030412c0533ca 100644 (file)
@@ -801,6 +801,8 @@ static int iwl_pcie_load_cpu_sections_8000(struct iwl_trans *trans,
 
        *first_ucode_section = last_read_idx;
 
+       iwl_enable_interrupts(trans);
+
        if (cpu == 1)
                iwl_write_direct32(trans, FH_UCODE_LOAD_STATUS, 0xFFFF);
        else
@@ -980,6 +982,8 @@ static int iwl_pcie_load_given_ucode(struct iwl_trans *trans,
                iwl_pcie_apply_destination(trans);
        }
 
+       iwl_enable_interrupts(trans);
+
        /* release CPU reset */
        iwl_write32(trans, CSR_RESET, 0);
 
@@ -1215,7 +1219,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
                ret = iwl_pcie_load_given_ucode_8000(trans, fw);
        else
                ret = iwl_pcie_load_given_ucode(trans, fw);
-       iwl_enable_interrupts(trans);
 
        /* re-check RF-Kill state since we may have missed the interrupt */
        hw_rfkill = iwl_is_rfkill_set(trans);