iwlwifi: mvm: only release the trans ref if d0i3 is supported in fw
authorLuca Coelho <luciano.coelho@intel.com>
Mon, 22 Feb 2016 13:44:13 +0000 (15:44 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 2 Mar 2016 06:59:19 +0000 (08:59 +0200)
If d0i3 is not supported by the firmware (or if it's disabled via
module parameters) we shouldn't release the initial transport
reference, so that we won't enter runtime suspend.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 4716176cbfe0d5c83f8d88cbd430e564fa413dfe..f3283f4ea3dfcd14975c79bbc03022e391921bb4 100644 (file)
@@ -672,8 +672,10 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
 
        memset(&mvm->rx_stats, 0, sizeof(struct mvm_statistics_rx));
 
-       /* rpm starts with a taken reference, we can release it now */
-       iwl_trans_unref(mvm->trans);
+       /* The transport always starts with a taken reference, we can
+        * release it now if d0i3 is supported */
+       if (iwl_mvm_is_d0i3_supported(mvm))
+               iwl_trans_unref(mvm->trans);
 
        iwl_mvm_tof_init(mvm);