linux/drivers/net/wireless/intel/iwlwifi
Emmanuel Grumbach a6bd005fe9 iwlwifi: pcie: fix RF-Kill vs. firmware load race
When we load the firmware, we hold trans_pcie->mutex to
avoid nested flows. We also rely on the ISR to wake up the
thread when the DMA has finished copying a chunk. During
this flow, we enable the RF-Kill interrupt.

The problem is that the RF-Kill interrupt handler can take
the mutex and bring the device down. This means that if
we load the firmware while the RF-Kill switch is enabled
(which will happen when we load the INIT firmware to read
the device's capabilities and register to mac80211), we
may get an RF-Kill interrupt immediately and the ISR will
be waiting for the mutex held by the thread that is
currently loading the firmware. At this stage, the ISR
won't be able to service the DMA's interrupt needed to
wake up the thread that load the firmware. We are in a
deadlock situation which ends when the thread that loads
the firmware fails on timeout and releases the mutex.

To fix this, take the mutex later in the flow, disable
the interrupts and synchronize_irq() to give a chance to
the RF-Kill interrupt to run and complete.
After that, mask all the interrupts besides the DMA
interrupt and proceed with firmware load. Make sure to
check that there was no RF-Kill interrupt when the
interrupts were disabled.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=111361

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-02-15 13:38:25 +02:00
..
dvm iwlwifi: dvm: fix WoWLAN 2016-01-07 19:01:09 +02:00
mvm iwlwifi: mvm: don't allow sched scans without matches to be started 2016-02-15 08:49:10 +02:00
pcie iwlwifi: pcie: fix RF-Kill vs. firmware load race 2016-02-15 13:38:25 +02:00
iwl-1000.c
iwl-2000.c
iwl-5000.c
iwl-6000.c
iwl-7000.c iwlwifi: update support for 3168 series firmware and NVM 2016-01-26 16:03:35 +02:00
iwl-8000.c iwlwifi: fix name of ucode loaded for 8265 series 2016-01-31 12:48:41 +02:00
iwl-9000.c iwlwifi: mvm: bump max API to 20 2016-01-07 19:01:26 +02:00
iwl-agn-hw.h
iwl-config.h
iwl-csr.h
iwl-debug.c
iwl-debug.h
iwl-devtrace-data.h iwlwifi: pcie: build an A-MSDU using TSO core 2015-12-20 23:27:37 +02:00
iwl-devtrace-io.h
iwl-devtrace-iwlwifi.h
iwl-devtrace-msg.h
iwl-devtrace-ucode.h
iwl-devtrace.c
iwl-devtrace.h
iwl-drv.c iwlwifi: fix name of ucode loaded for 8265 series 2016-01-31 12:48:41 +02:00
iwl-drv.h
iwl-eeprom-parse.c iwlwifi: fix printf specifier 2015-12-21 10:12:08 +02:00
iwl-eeprom-parse.h
iwl-eeprom-read.c
iwl-eeprom-read.h
iwl-fh.h
iwl-fw-error-dump.h iwlwifi: mvm: dump the radio registers when the firmware crashes 2016-01-07 19:01:28 +02:00
iwl-fw-file.h iwlwifi: mvm: add a non-trigger window to fw dbg triggers 2016-01-07 19:01:28 +02:00
iwl-fw.h
iwl-io.c iwlwifi: remove unused parameter from grab_nic_access 2015-12-21 10:11:39 +02:00
iwl-io.h
iwl-modparams.h
iwl-notif-wait.c
iwl-notif-wait.h
iwl-nvm-parse.c
iwl-nvm-parse.h
iwl-op-mode.h
iwl-phy-db.c
iwl-phy-db.h
iwl-prph.h iwlwifi: mvm: dump the radio registers when the firmware crashes 2016-01-07 19:01:28 +02:00
iwl-scd.h
iwl-trans.c
iwl-trans.h iwlwifi: mvm: constify the parameters of a few functions in fw-dbg.c 2016-01-07 19:01:32 +02:00
Kconfig iwlwifi: dvm: remove a wrong dependency on m 2016-02-10 18:16:31 +02:00
Makefile