* [PATCH 1/6] iwlwifi: dvm: drop VO packets when mac80211 tells us to
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 2/6] iwlwifi: mvm: disconnect if CSA time event fails scheduling Emmanuel Grumbach
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach
mac80211 now informs the driver when to drop the packets
upon flush(). This will happen before disconnecting, or
before we shut down the interface. We can now rely on this
to drop all the packets including the VO queues.
When mac80211 sets drop to false, wait for all the queues
to be empty.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/dvm/mac80211.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index 47e64e8..cceb026 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -1114,16 +1114,17 @@ static void iwlagn_mac_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
scd_queues &= ~(BIT(IWL_IPAN_CMD_QUEUE_NUM) |
BIT(IWL_DEFAULT_CMD_QUEUE_NUM));
- if (vif)
- scd_queues &= ~BIT(vif->hw_queue[IEEE80211_AC_VO]);
-
- IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n", scd_queues);
- if (iwlagn_txfifo_flush(priv, scd_queues)) {
- IWL_ERR(priv, "flush request fail\n");
- goto done;
+ if (drop) {
+ IWL_DEBUG_TX_QUEUES(priv, "Flushing SCD queues: 0x%x\n",
+ scd_queues);
+ if (iwlagn_txfifo_flush(priv, scd_queues)) {
+ IWL_ERR(priv, "flush request fail\n");
+ goto done;
+ }
}
+
IWL_DEBUG_TX_QUEUES(priv, "wait transmit/flush all frames\n");
- iwl_trans_wait_tx_queue_empty(priv->trans, 0xffffffff);
+ iwl_trans_wait_tx_queue_empty(priv->trans, scd_queues);
done:
mutex_unlock(&priv->mutex);
IWL_DEBUG_MAC80211(priv, "leave\n");
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/6] iwlwifi: mvm: disconnect if CSA time event fails scheduling
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
2015-03-22 17:21 ` [PATCH 1/6] iwlwifi: dvm: drop VO packets when mac80211 tells us to Emmanuel Grumbach
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 3/6] iwlwifi: dvm: run INIT firmware again upon .start() Emmanuel Grumbach
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach
From: Johannes Berg <johannes.berg@intel.com>
If this situation ever happens, the mac80211 state machine gets
confused because it never clears csa_active. There was a separate
bug that lead to this happening with a working connection, but it
isn't very robust to try to keep the connection up in this case.
When removing the time event the CSA essentially procedure stops,
so the safest thing to do is to disconnect in this case.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/time-event.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/iwlwifi/mvm/time-event.c b/drivers/net/wireless/iwlwifi/mvm/time-event.c
index f8d6f30..4b81c0b 100644
--- a/drivers/net/wireless/iwlwifi/mvm/time-event.c
+++ b/drivers/net/wireless/iwlwifi/mvm/time-event.c
@@ -197,6 +197,8 @@ iwl_mvm_te_handle_notify_csa(struct iwl_mvm *mvm,
struct iwl_time_event_notif *notif)
{
if (!le32_to_cpu(notif->status)) {
+ if (te_data->vif->type == NL80211_IFTYPE_STATION)
+ ieee80211_connection_loss(te_data->vif);
IWL_DEBUG_TE(mvm, "CSA time event failed to start\n");
iwl_mvm_te_clear_data(mvm, te_data);
return;
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/6] iwlwifi: dvm: run INIT firmware again upon .start()
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
2015-03-22 17:21 ` [PATCH 1/6] iwlwifi: dvm: drop VO packets when mac80211 tells us to Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 2/6] iwlwifi: mvm: disconnect if CSA time event fails scheduling Emmanuel Grumbach
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 4/6] iwlwifi: mvm: protect rate scaling against non-mvm IBSS stations Emmanuel Grumbach
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Emmanuel Grumbach, stable
The assumption before this patch was that we don't need to
run again the INIT firmware after the system booted. The
INIT firmware runs calibrations which impact the physical
layer's behavior.
Users reported that it may be helpful to run these
calibrations again every time the interface is brought up.
The penatly is minimal, since the calibrations run fast.
This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=94341
CC: <stable@vger.kernel.org>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/dvm/dev.h | 1 -
drivers/net/wireless/iwlwifi/dvm/ucode.c | 5 -----
2 files changed, 6 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index a6f22c3..3811878 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -708,7 +708,6 @@ struct iwl_priv {
unsigned long reload_jiffies;
int reload_count;
bool ucode_loaded;
- bool init_ucode_run; /* Don't run init uCode again */
u8 plcp_delta_threshold;
diff --git a/drivers/net/wireless/iwlwifi/dvm/ucode.c b/drivers/net/wireless/iwlwifi/dvm/ucode.c
index 4dbef7e..5244e43 100644
--- a/drivers/net/wireless/iwlwifi/dvm/ucode.c
+++ b/drivers/net/wireless/iwlwifi/dvm/ucode.c
@@ -418,9 +418,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)
if (!priv->fw->img[IWL_UCODE_INIT].sec[0].len)
return 0;
- if (priv->init_ucode_run)
- return 0;
-
iwl_init_notification_wait(&priv->notif_wait, &calib_wait,
calib_complete, ARRAY_SIZE(calib_complete),
iwlagn_wait_calib, priv);
@@ -440,8 +437,6 @@ int iwl_run_init_ucode(struct iwl_priv *priv)
*/
ret = iwl_wait_notification(&priv->notif_wait, &calib_wait,
UCODE_CALIB_TIMEOUT);
- if (!ret)
- priv->init_ucode_run = true;
goto out;
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/6] iwlwifi: mvm: protect rate scaling against non-mvm IBSS stations
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
` (2 preceding siblings ...)
2015-03-22 17:21 ` [PATCH 3/6] iwlwifi: dvm: run INIT firmware again upon .start() Emmanuel Grumbach
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 5/6] iwlwifi: add new 3165 series PCI IDs Emmanuel Grumbach
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, stable, Emmanuel Grumbach
From: Johannes Berg <johannes.berg@intel.com>
When the driver callback returns that it's out of space for new
stations, the mac80211 IBSS code still keeps the station so it
doesn't try to add it over and over again.
Since the rate scaling algorithm is separate in mac80211, it also
invokes the rate scaling algorithm for such stations. It doesn't
know that our rate scaling algorithm is tightly integrated with
the MVM code and relies on those data structures, and it cannot
as the abstraction doesn't allow for it.
This leads to crashes when the rate scaling algorithm tries to
use uninitialized data, notably the mvmsta->vif pointer.
Protect against this in the rate scaling algorithm. We cannot get
good rates with such peers anyway since the firmware cannot do
anything with them.
This should fix https://bugzilla.kernel.org/show_bug.cgi?id=93461
CC: <stable@vger.kernel.org>
Reported-by: Richard Taylor <rjt-kernel@thegrindstone.me.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/rs.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c
index efa9688..078f24c 100644
--- a/drivers/net/wireless/iwlwifi/mvm/rs.c
+++ b/drivers/net/wireless/iwlwifi/mvm/rs.c
@@ -1278,6 +1278,9 @@ static void rs_mac80211_tx_status(void *mvm_r,
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ if (!iwl_mvm_sta_from_mac80211(sta)->vif)
+ return;
+
if (!ieee80211_is_data(hdr->frame_control) ||
info->flags & IEEE80211_TX_CTL_NO_ACK)
return;
@@ -2511,6 +2514,14 @@ static void rs_get_rate(void *mvm_r, struct ieee80211_sta *sta, void *mvm_sta,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct iwl_lq_sta *lq_sta = mvm_sta;
+ if (sta && !iwl_mvm_sta_from_mac80211(sta)->vif) {
+ /* if vif isn't initialized mvm doesn't know about
+ * this station, so don't do anything with the it
+ */
+ sta = NULL;
+ mvm_sta = NULL;
+ }
+
/* TODO: handle rate_idx_mask and rate_idx_mcs_mask */
/* Treat uninitialized rate scaling data same as non-existing. */
@@ -2827,6 +2838,9 @@ static void rs_rate_update(void *mvm_r,
(struct iwl_op_mode *)mvm_r;
struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode);
+ if (!iwl_mvm_sta_from_mac80211(sta)->vif)
+ return;
+
/* Stop any ongoing aggregations as rs starts off assuming no agg */
for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++)
ieee80211_stop_tx_ba_session(sta, tid);
@@ -3587,9 +3601,15 @@ static ssize_t iwl_dbgfs_ss_force_write(struct iwl_lq_sta *lq_sta, char *buf,
MVM_DEBUGFS_READ_WRITE_FILE_OPS(ss_force, 32);
-static void rs_add_debugfs(void *mvm, void *mvm_sta, struct dentry *dir)
+static void rs_add_debugfs(void *mvm, void *priv_sta, struct dentry *dir)
{
- struct iwl_lq_sta *lq_sta = mvm_sta;
+ struct iwl_lq_sta *lq_sta = priv_sta;
+ struct iwl_mvm_sta *mvmsta;
+
+ mvmsta = container_of(lq_sta, struct iwl_mvm_sta, lq_sta);
+
+ if (!mvmsta->vif)
+ return;
debugfs_create_file("rate_scale_table", S_IRUSR | S_IWUSR, dir,
lq_sta, &rs_sta_dbgfs_scale_table_ops);
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/6] iwlwifi: add new 3165 series PCI IDs
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
` (3 preceding siblings ...)
2015-03-22 17:21 ` [PATCH 4/6] iwlwifi: mvm: protect rate scaling against non-mvm IBSS stations Emmanuel Grumbach
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-22 17:21 ` [PATCH 6/6] iwlwifi: mvm: remove WARN_ON for invalid BA notification Emmanuel Grumbach
2015-03-23 4:49 ` pull request: iwlwifi 2015-03-22 Kalle Valo
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Oren Givon, Emmanuel Grumbach
From: Oren Givon <oren.givon@intel.com>
Add new 3165 PCI IDs for new 1x1 cards.
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/pcie/drv.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index dbd6bcf..686dd30 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -368,10 +368,12 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
/* 3165 Series */
{IWL_PCI_DEVICE(0x3165, 0x4010, iwl3165_2ac_cfg)},
{IWL_PCI_DEVICE(0x3165, 0x4012, iwl3165_2ac_cfg)},
- {IWL_PCI_DEVICE(0x3165, 0x4110, iwl3165_2ac_cfg)},
- {IWL_PCI_DEVICE(0x3165, 0x4210, iwl3165_2ac_cfg)},
{IWL_PCI_DEVICE(0x3165, 0x4410, iwl3165_2ac_cfg)},
{IWL_PCI_DEVICE(0x3165, 0x4510, iwl3165_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x3165, 0x4110, iwl3165_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x3166, 0x4310, iwl3165_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x3166, 0x4210, iwl3165_2ac_cfg)},
+ {IWL_PCI_DEVICE(0x3165, 0x8010, iwl3165_2ac_cfg)},
/* 7265 Series */
{IWL_PCI_DEVICE(0x095A, 0x5010, iwl7265_2ac_cfg)},
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 6/6] iwlwifi: mvm: remove WARN_ON for invalid BA notification
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
` (4 preceding siblings ...)
2015-03-22 17:21 ` [PATCH 5/6] iwlwifi: add new 3165 series PCI IDs Emmanuel Grumbach
@ 2015-03-22 17:21 ` Emmanuel Grumbach
2015-03-23 4:49 ` pull request: iwlwifi 2015-03-22 Kalle Valo
6 siblings, 0 replies; 8+ messages in thread
From: Emmanuel Grumbach @ 2015-03-22 17:21 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Emmanuel Grumbach
From: Johannes Berg <johannes.berg@intel.com>
The firmware frequently manages to trigger this, and there's
no known driver workaround, so stop warning.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
drivers/net/wireless/iwlwifi/mvm/tx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index 07304e1..96a0540 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -949,8 +949,10 @@ int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
mvmsta = iwl_mvm_sta_from_mac80211(sta);
tid_data = &mvmsta->tid_data[tid];
- if (WARN_ONCE(tid_data->txq_id != scd_flow, "Q %d, tid %d, flow %d",
- tid_data->txq_id, tid, scd_flow)) {
+ if (tid_data->txq_id != scd_flow) {
+ IWL_ERR(mvm,
+ "invalid BA notification: Q %d, tid %d, flow %d\n",
+ tid_data->txq_id, tid, scd_flow);
rcu_read_unlock();
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: pull request: iwlwifi 2015-03-22
2015-03-22 17:19 pull request: iwlwifi 2015-03-22 Grumbach, Emmanuel
` (5 preceding siblings ...)
2015-03-22 17:21 ` [PATCH 6/6] iwlwifi: mvm: remove WARN_ON for invalid BA notification Emmanuel Grumbach
@ 2015-03-23 4:49 ` Kalle Valo
6 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2015-03-23 4:49 UTC (permalink / raw)
To: Grumbach, Emmanuel; +Cc: linux-wireless@vger.kernel.org
"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com> writes:
> Hi Kalle,
>
> A new round of fixes for 4.0. Most of the patches are also CCed to
> stable. Details in the tag. Thanks!
>
> The following changes since commit 4cd4b50cc2429294c23a1998c33fdfd804db0f37:
>
> iwlwifi: mvm: BT Coex - fix a NULL pointer exception (2015-03-05 14:13:20 +0200)
>
> are available in the git repository at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git tags/iwlwifi-for-kalle-2015-03-22
>
> for you to fetch changes up to 1f16ea294d2ef63013740f4c8539e430b6c12dff:
>
> iwlwifi: mvm: remove WARN_ON for invalid BA notification (2015-03-19 15:43:11 +0200)
>
> ----------------------------------------------------------------
> * avoid panic with lots of IBSS stations
> * Fix dvm's behavior after suspend resume
> * Allow to keep connection after CSA failure
> * Remove a noisy by harmless WARN_ON
> * New device IDs
>
> ----------------------------------------------------------------
Thanks, pulled.
--
Kalle Valo
^ permalink raw reply [flat|nested] 8+ messages in thread