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c3MvaXdsd2lmaS9tdm0vcnMuYyAgICAgICAg IHwgMjQgKysrKysrKysrKysrKysrKysrKysrKy0tDQogZHJpdmVycy9uZXQvd2lyZWxlc3MvaXds d2lmaS9tdm0vdGltZS1ldmVudC5jIHwgIDIgKysNCiBkcml2ZXJzL25ldC93aXJlbGVzcy9pd2x3 aWZpL212bS90eC5jICAgICAgICAgfCAgNiArKysrLS0NCiBkcml2ZXJzL25ldC93aXJlbGVzcy9p d2x3aWZpL3BjaWUvZHJ2LmMgICAgICAgfCAgNiArKysrLS0NCiA3IGZpbGVzIGNoYW5nZWQsIDQx IGluc2VydGlvbnMoKyksIDIwIGRlbGV0aW9ucygtKQ0KDQo=
PATCH 1/6 iwlwifi: dvm: drop VO packets when mac80211 tells us to
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.
--- drivers/net/wireless/iwlwifi/dvm/mac80211.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/dvm/mac80211.c +9 -8
@@ -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" );
Signature · 1 line
1.9.1
PATCH 2/6 iwlwifi: mvm: disconnect if CSA time event fails scheduling
In reply to Grumbach, EmmanuelFrom: Johannes Berg <[email protected]>
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.
--- drivers/net/wireless/iwlwifi/mvm/time-event.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wireless/iwlwifi/mvm/time-event.c +2 -0
@@ -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 ;
Signature · 1 line
1.9.1
PATCH 3/6 iwlwifi: dvm: run INIT firmware again upon .start()
In reply to Grumbach, EmmanuelThe 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
--- drivers/net/wireless/iwlwifi/dvm/dev.h | 1 - drivers/net/wireless/iwlwifi/dvm/ucode.c | 5 ----- 2 files changed, 6 deletions(-)
drivers/net/wireless/iwlwifi/dvm/dev.h +0 -1
@@ -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;
drivers/net/wireless/iwlwifi/dvm/ucode.c +0 -5
@@ -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;
Signature · 1 line
1.9.1
PATCH 4/6 iwlwifi: mvm: protect rate scaling against non-mvm IBSS stations
In reply to Grumbach, EmmanuelFrom: Johannes Berg <[email protected]>
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
--- drivers/net/wireless/iwlwifi/mvm/rs.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/rs.c +22 -2
@@ -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);
Signature · 1 line
1.9.1
PATCH 5/6 iwlwifi: add new 3165 series PCI IDs
In reply to Grumbach, EmmanuelFrom: Oren Givon <[email protected]>
Add new 3165 PCI IDs for new 1x1 cards.
--- drivers/net/wireless/iwlwifi/pcie/drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/pcie/drv.c +4 -2
@@ -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)},
Signature · 1 line
1.9.1
PATCH 6/6 iwlwifi: mvm: remove WARN_ON for invalid BA notification
In reply to Grumbach, EmmanuelFrom: Johannes Berg <[email protected]>
The firmware frequently manages to trigger this, and there's no known driver workaround, so stop warning.
--- drivers/net/wireless/iwlwifi/mvm/tx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/iwlwifi/mvm/tx.c +4 -2
@@ -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 ; }
Signature · 1 line
1.9.1
Quoted 17 lines · Emmanuel
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_ONfor invalid BA notification (2015-03-19 15:43:11 +0200)
Quoted 8 lines
----------------------------------------------------------------
* 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 harmlessWARN_ON
* New device IDs----------------------------------------------------------------
Thanks, pulled.
Signature · 1 line
Kalle Valo