iwlwifi: mvm: make sure d0i3 exit work runs before suspending
authorLuciano Coelho <luciano.coelho@intel.com>
Mon, 24 Aug 2015 11:53:25 +0000 (14:53 +0300)
committerLuciano Coelho <luciano.coelho@intel.com>
Fri, 28 Aug 2015 10:26:34 +0000 (13:26 +0300)
commitcf8c3cff3fcce966c6d31001c09c92778f961eea
tree03e0ddf2fb5f4386a9dcc369c6cf149bb73cc8ac
parent9493908095a3d0b4fa24ff529975376b3a2b8394
iwlwifi: mvm: make sure d0i3 exit work runs before suspending

If we are in d0i3 when entering suspend, we leave d0i3 so that
mac80211 can call us to remove connections or whatever before going to
suspend.  We do this by calling pm_runtime_resume() early in the slave
transport flow and reactivating it later, when the wiphy suspend flow
runs.

The problem is that we queue a work in order to leave d0i3.  If this
work hasn't run yet when the wiphy suspend flow is called, we have a
race and entering d0i3 fails (because we're still holding the
IWL_MVM_REF_EXIT_WORK reference).

To solve this, simply flush the d0i3_exit_work at the beginning of the
iwl_mvm_suspend() function.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
drivers/net/wireless/iwlwifi/mvm/d3.c