summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch85
1 files changed, 85 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch
new file mode 100644
index 00000000..cdd9c4a0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.17/0145-iwlwifi-do-not-nulify-ctx-vif-on-reset.patch
@@ -0,0 +1,85 @@
1From 3fabef3cff16e308410b75ac612ba271be969051 Mon Sep 17 00:00:00 2001
2From: Stanislaw Gruszka <sgruszka@redhat.com>
3Date: Wed, 18 Apr 2012 08:01:15 -0700
4Subject: [PATCH 145/165] iwlwifi: do not nulify ctx->vif on reset
5
6commit 8db4c7e25d153fb049e81715d72fa3be3a0c3b69 upstream.
7
8ctx->vif is dereferenced in different part of iwlwifi code, so do not
9nullify it.
10
11This should address at least one of the possible reasons of WARNING at
12iwlagn_mac_remove_interface, and perhaps some random crashes when
13firmware reset is performed.
14
15Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
16Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
17Signed-off-by: John W. Linville <linville@tuxdriver.com>
18[bwh: Backported to 3.2:
19 - Change filename iwl-mac80211.c to iwl-core.c
20 - Change context in iwlagn_prepare_restart()]
21Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
22---
23 drivers/net/wireless/iwlwifi/iwl-agn.c | 3 ---
24 drivers/net/wireless/iwlwifi/iwl-core.c | 10 +++++++++-
25 2 files changed, 9 insertions(+), 4 deletions(-)
26
27diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
28index e0e9a3d..d7d2512 100644
29--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
30+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
31@@ -1504,7 +1504,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
32
33 static void iwlagn_prepare_restart(struct iwl_priv *priv)
34 {
35- struct iwl_rxon_context *ctx;
36 bool bt_full_concurrent;
37 u8 bt_ci_compliance;
38 u8 bt_load;
39@@ -1513,8 +1512,6 @@ static void iwlagn_prepare_restart(struct iwl_priv *priv)
40
41 lockdep_assert_held(&priv->shrd->mutex);
42
43- for_each_context(priv, ctx)
44- ctx->vif = NULL;
45 priv->is_open = 0;
46
47 /*
48diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
49index 3d75d4c..832ec4d 100644
50--- a/drivers/net/wireless/iwlwifi/iwl-core.c
51+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
52@@ -1228,6 +1228,7 @@ int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
53 struct iwl_rxon_context *tmp, *ctx = NULL;
54 int err;
55 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
56+ bool reset = false;
57
58 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
59 viftype, vif->addr);
60@@ -1249,6 +1250,13 @@ int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
61 tmp->interface_modes | tmp->exclusive_interface_modes;
62
63 if (tmp->vif) {
64+ /* On reset we need to add the same interface again */
65+ if (tmp->vif == vif) {
66+ reset = true;
67+ ctx = tmp;
68+ break;
69+ }
70+
71 /* check if this busy context is exclusive */
72 if (tmp->exclusive_interface_modes &
73 BIT(tmp->vif->type)) {
74@@ -1275,7 +1283,7 @@ int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
75 ctx->vif = vif;
76
77 err = iwl_setup_interface(priv, ctx);
78- if (!err)
79+ if (!err || reset)
80 goto out;
81
82 ctx->vif = NULL;
83--
841.7.7.6
85