linux_dsm_epyc7002/drivers/net/wireless
Emmanuel Grumbach 2220fb2960 iwlwifi: split the handler and the wake parts of the notification infra
The notification infrastructure (iwl_notification_wait_*
functions) allows to wait until a list of notifications
will come up from the firmware and to run a special handler
(notif_wait handler) when those are received.

The operation mode notifies the notification infrastructure
about any Rx being received by the mean of
iwl_notification_wait_notify() which will do two things:
1) call the notif_wait handler
2) wakeup the thread that was waiting for the notification

Typically, only after those two steps happened, the
operation mode will run its own handler for the notification
that was received from the firmware. This means that the
thread that was waiting for that notification can be
running before the operation mode's handler was called.

When the operation mode's handler is ASYNC, things get even
worse since the thread that was waiting for the
notification isn't even guaranteed that the ASYNC callback
was added to async_handlers_list before it starts to run.
This means that even calling
iwl_mvm_wait_for_async_handlers() can't guarantee that
absolutely everything related to that notification has run.
The following can happen:

Thread sending the command        Operation mode's Rx path
--------------------------        ------------------------
iwl_init_notification_wait()
iwl_mvm_send_cmd()
                                  iwl_mvm_rx_common()
                                  iwl_notification_wait_notify()
iwl_mvm_wait_for_async_handlers()
// Possibly free some data
// structure
                                  list_add_tail(async_handlers_list);
                                  schedule_work(async_handlers_wk);
                                  // Access the freed structure

Split the 'run notif_wait's handler' and the 'wake up the
thread' parts to fix this. This allows the operation mode
to do the following:

Thread sending the command        Operation mode's Rx path
--------------------------        ------------------------
iwl_init_notification_wait()
iwl_mvm_send_cmd()
                                  iwl_mvm_rx_common()
                                  iwl_notification_wait()
                                  // Will run the notif_wait's handler
                                  list_add_tail(async_handlers_list);
                                  schedule_work(async_handlers_wk);
                                  iwl_notification_notify()
iwl_mvm_wait_for_async_handlers()

This way, the waiter is guaranteed that all the handlers
have been run (if SYNC), or at least enqueued (if ASYNC)
by the time it wakes up.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19 22:21:49 +03:00
..
admtek adm80211: return an error if adm8211_alloc_rings() fails 2016-12-30 13:29:21 +02:00
ath wireless-drivers-next patches for 4.12 2017-04-09 18:13:12 -07:00
atmel atmel: remove time_t usage 2017-03-20 18:43:17 +02:00
broadcom brcmfmac: only build fwsignal module for CONFIG_BRCMFMAC_PROTO_BCDC 2017-04-19 14:39:44 +03:00
cisco net: use core MTU range checking in wireless drivers 2016-10-20 14:51:08 -04:00
intel iwlwifi: split the handler and the wake parts of the notification infra 2017-04-19 22:21:49 +03:00
intersil sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h> 2017-03-02 08:42:32 +01:00
marvell mwifiex: Fix invalid port issue 2017-04-13 17:05:19 +03:00
mediatek Makefile: drop -D__CHECK_ENDIAN__ from cflags 2016-12-16 00:13:43 +02:00
ralink rt2x00: reverse external PA capability flag logic 2017-04-13 17:12:32 +03:00
realtek rtlwifi: btcoex: 21a 1ant: avoid LPS/IPS mismatch for pnp notify 2017-04-13 17:11:04 +03:00
rsi scripts/spelling.txt: add "deintialize(d)" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
st drivers: add explicit interrupt.h includes 2017-03-30 11:05:34 -07:00
ti wlcore: fix spelling mistakes in wl1271_warning 2017-04-05 15:45:29 +03:00
zydas zd1211rw: fix NULL-deref at probe 2017-03-22 11:03:37 +02:00
Kconfig wireless: deprecate WDS and disable by default 2016-10-27 09:08:43 +02:00
mac80211_hwsim.c mac80211_hwsim: check HWSIM_ATTR_RADIO_NAME length 2017-02-27 17:15:28 +01:00
mac80211_hwsim.h
Makefile
ray_cs.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
ray_cs.h
rayctl.h
rndis_wlan.c net: usbnet: support 64bit stats 2017-04-03 19:09:40 -07:00
wl3501_cs.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
wl3501.h