Skip to content

Commit bf601fe

Browse files
committed
Merge tag 'wireless-drivers-for-davem-2017-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
Kalle Valo says: ==================== wireless-drivers fixes for 4.11 iwlwifi * fix a user reported warning in DQA mwifiex * fix a potential double free * fix lost early debug logs * fix init wakeup warning message from device framework * add Ganapathi and Xinming as maintainers ath10k * fix regression with QCA6174 during resume and firmware crash ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 557d054 + 6be3b6c commit bf601fe

File tree

8 files changed

+57
-55
lines changed

8 files changed

+57
-55
lines changed

MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7846,6 +7846,8 @@ F: drivers/net/ethernet/marvell/mvneta.*
78467846
MARVELL MWIFIEX WIRELESS DRIVER
78477847
M: Amitkumar Karwar <[email protected]>
78487848
M: Nishant Sarmukadam <[email protected]>
7849+
M: Ganapathi Bhat <[email protected]>
7850+
M: Xinming Hu <[email protected]>
78497851
78507852
S: Maintained
78517853
F: drivers/net/wireless/marvell/mwifiex/

drivers/net/wireless/ath/ath10k/hw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const struct ath10k_hw_regs qca6174_regs = {
5151
.rtc_soc_base_address = 0x00000800,
5252
.rtc_wmac_base_address = 0x00001000,
5353
.soc_core_base_address = 0x0003a000,
54-
.wlan_mac_base_address = 0x00020000,
54+
.wlan_mac_base_address = 0x00010000,
5555
.ce_wrapper_base_address = 0x00034000,
5656
.ce0_base_address = 0x00034400,
5757
.ce1_base_address = 0x00034800,

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,7 @@ iwl_mvm_mac_release_buffered_frames(struct ieee80211_hw *hw,
23192319
{
23202320
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
23212321

2322-
/* Called when we need to transmit (a) frame(s) from agg queue */
2322+
/* Called when we need to transmit (a) frame(s) from agg or dqa queue */
23232323

23242324
iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames,
23252325
tids, more_data, true);
@@ -2338,7 +2338,8 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw,
23382338
for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) {
23392339
struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
23402340

2341-
if (tid_data->state != IWL_AGG_ON &&
2341+
if (!iwl_mvm_is_dqa_supported(mvm) &&
2342+
tid_data->state != IWL_AGG_ON &&
23422343
tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA)
23432344
continue;
23442345

drivers/net/wireless/intel/iwlwifi/mvm/sta.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,7 +3135,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm,
31353135
struct ieee80211_sta *sta,
31363136
enum ieee80211_frame_release_type reason,
31373137
u16 cnt, u16 tids, bool more_data,
3138-
bool agg)
3138+
bool single_sta_queue)
31393139
{
31403140
struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
31413141
struct iwl_mvm_add_sta_cmd cmd = {
@@ -3155,14 +3155,14 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm,
31553155
for_each_set_bit(tid, &_tids, IWL_MAX_TID_COUNT)
31563156
cmd.awake_acs |= BIT(tid_to_ucode_ac[tid]);
31573157

3158-
/* If we're releasing frames from aggregation queues then check if the
3159-
* all queues combined that we're releasing frames from have
3158+
/* If we're releasing frames from aggregation or dqa queues then check
3159+
* if all the queues that we're releasing frames from, combined, have:
31603160
* - more frames than the service period, in which case more_data
31613161
* needs to be set
31623162
* - fewer than 'cnt' frames, in which case we need to adjust the
31633163
* firmware command (but do that unconditionally)
31643164
*/
3165-
if (agg) {
3165+
if (single_sta_queue) {
31663166
int remaining = cnt;
31673167
int sleep_tx_count;
31683168

@@ -3172,7 +3172,8 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm,
31723172
u16 n_queued;
31733173

31743174
tid_data = &mvmsta->tid_data[tid];
3175-
if (WARN(tid_data->state != IWL_AGG_ON &&
3175+
if (WARN(!iwl_mvm_is_dqa_supported(mvm) &&
3176+
tid_data->state != IWL_AGG_ON &&
31763177
tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA,
31773178
"TID %d state is %d\n",
31783179
tid, tid_data->state)) {

drivers/net/wireless/intel/iwlwifi/mvm/sta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm,
547547
struct ieee80211_sta *sta,
548548
enum ieee80211_frame_release_type reason,
549549
u16 cnt, u16 tids, bool more_data,
550-
bool agg);
550+
bool single_sta_queue);
551551
int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
552552
bool drain);
553553
void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm,

drivers/net/wireless/intel/iwlwifi/mvm/tx.c

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10-
* Copyright(c) 2016 Intel Deutschland GmbH
10+
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
1111
*
1212
* This program is free software; you can redistribute it and/or modify
1313
* it under the terms of version 2 of the GNU General Public License as
@@ -34,6 +34,7 @@
3434
*
3535
* Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3636
* Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37+
* Copyright(c) 2016 - 2017 Intel Deutschland GmbH
3738
* All rights reserved.
3839
*
3940
* Redistribution and use in source and binary forms, with or without
@@ -628,8 +629,10 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb)
628629
* values.
629630
* Note that we don't need to make sure it isn't agg'd, since we're
630631
* TXing non-sta
632+
* For DQA mode - we shouldn't increase it though
631633
*/
632-
atomic_inc(&mvm->pending_frames[sta_id]);
634+
if (!iwl_mvm_is_dqa_supported(mvm))
635+
atomic_inc(&mvm->pending_frames[sta_id]);
633636

634637
return 0;
635638
}
@@ -1005,11 +1008,8 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb,
10051008

10061009
spin_unlock(&mvmsta->lock);
10071010

1008-
/* Increase pending frames count if this isn't AMPDU */
1009-
if ((iwl_mvm_is_dqa_supported(mvm) &&
1010-
mvmsta->tid_data[tx_cmd->tid_tspec].state != IWL_AGG_ON &&
1011-
mvmsta->tid_data[tx_cmd->tid_tspec].state != IWL_AGG_STARTING) ||
1012-
(!iwl_mvm_is_dqa_supported(mvm) && !is_ampdu))
1011+
/* Increase pending frames count if this isn't AMPDU or DQA queue */
1012+
if (!iwl_mvm_is_dqa_supported(mvm) && !is_ampdu)
10131013
atomic_inc(&mvm->pending_frames[mvmsta->sta_id]);
10141014

10151015
return 0;
@@ -1079,12 +1079,13 @@ static void iwl_mvm_check_ratid_empty(struct iwl_mvm *mvm,
10791079
lockdep_assert_held(&mvmsta->lock);
10801080

10811081
if ((tid_data->state == IWL_AGG_ON ||
1082-
tid_data->state == IWL_EMPTYING_HW_QUEUE_DELBA) &&
1082+
tid_data->state == IWL_EMPTYING_HW_QUEUE_DELBA ||
1083+
iwl_mvm_is_dqa_supported(mvm)) &&
10831084
iwl_mvm_tid_queued(tid_data) == 0) {
10841085
/*
1085-
* Now that this aggregation queue is empty tell mac80211 so it
1086-
* knows we no longer have frames buffered for the station on
1087-
* this TID (for the TIM bitmap calculation.)
1086+
* Now that this aggregation or DQA queue is empty tell
1087+
* mac80211 so it knows we no longer have frames buffered for
1088+
* the station on this TID (for the TIM bitmap calculation.)
10881089
*/
10891090
ieee80211_sta_set_buffered(sta, tid, false);
10901091
}
@@ -1257,7 +1258,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
12571258
u8 skb_freed = 0;
12581259
u16 next_reclaimed, seq_ctl;
12591260
bool is_ndp = false;
1260-
bool txq_agg = false; /* Is this TXQ aggregated */
12611261

12621262
__skb_queue_head_init(&skbs);
12631263

@@ -1283,6 +1283,10 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
12831283
info->flags |= IEEE80211_TX_STAT_ACK;
12841284
break;
12851285
case TX_STATUS_FAIL_DEST_PS:
1286+
/* In DQA, the FW should have stopped the queue and not
1287+
* return this status
1288+
*/
1289+
WARN_ON(iwl_mvm_is_dqa_supported(mvm));
12861290
info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
12871291
break;
12881292
default:
@@ -1387,15 +1391,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
13871391
bool send_eosp_ndp = false;
13881392

13891393
spin_lock_bh(&mvmsta->lock);
1390-
if (iwl_mvm_is_dqa_supported(mvm)) {
1391-
enum iwl_mvm_agg_state state;
1392-
1393-
state = mvmsta->tid_data[tid].state;
1394-
txq_agg = (state == IWL_AGG_ON ||
1395-
state == IWL_EMPTYING_HW_QUEUE_DELBA);
1396-
} else {
1397-
txq_agg = txq_id >= mvm->first_agg_queue;
1398-
}
13991394

14001395
if (!is_ndp) {
14011396
tid_data->next_reclaimed = next_reclaimed;
@@ -1452,11 +1447,11 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm,
14521447
* If the txq is not an AMPDU queue, there is no chance we freed
14531448
* several skbs. Check that out...
14541449
*/
1455-
if (txq_agg)
1450+
if (iwl_mvm_is_dqa_supported(mvm) || txq_id >= mvm->first_agg_queue)
14561451
goto out;
14571452

14581453
/* We can't free more than one frame at once on a shared queue */
1459-
WARN_ON(!iwl_mvm_is_dqa_supported(mvm) && (skb_freed > 1));
1454+
WARN_ON(skb_freed > 1);
14601455

14611456
/* If we have still frames for this STA nothing to do here */
14621457
if (!atomic_sub_and_test(skb_freed, &mvm->pending_frames[sta_id]))

drivers/net/wireless/marvell/mwifiex/main.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0");
5757
* In case of any errors during inittialization, this function also ensures
5858
* proper cleanup before exiting.
5959
*/
60-
static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
61-
void **padapter)
60+
static int mwifiex_register(void *card, struct device *dev,
61+
struct mwifiex_if_ops *if_ops, void **padapter)
6262
{
6363
struct mwifiex_adapter *adapter;
6464
int i;
@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
6868
return -ENOMEM;
6969

7070
*padapter = adapter;
71+
adapter->dev = dev;
7172
adapter->card = card;
7273

7374
/* Save interface specific operations in adapter */
@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done,
15681569
{
15691570
struct mwifiex_adapter *adapter;
15701571

1571-
if (mwifiex_register(card, if_ops, (void **)&adapter)) {
1572+
if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) {
15721573
pr_err("%s: software init failed\n", __func__);
15731574
goto err_init_sw;
15741575
}
15751576

1576-
adapter->dev = dev;
15771577
mwifiex_probe_of(adapter);
15781578

15791579
adapter->iface_type = iface_type;
@@ -1718,6 +1718,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter)
17181718
wiphy_unregister(adapter->wiphy);
17191719
wiphy_free(adapter->wiphy);
17201720

1721+
if (adapter->irq_wakeup >= 0)
1722+
device_init_wakeup(adapter->dev, false);
1723+
17211724
/* Unregister device */
17221725
mwifiex_dbg(adapter, INFO,
17231726
"info: unregister device\n");

drivers/net/wireless/marvell/mwifiex/pcie.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,6 +2739,21 @@ static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter)
27392739
schedule_work(&card->work);
27402740
}
27412741

2742+
static void mwifiex_pcie_free_buffers(struct mwifiex_adapter *adapter)
2743+
{
2744+
struct pcie_service_card *card = adapter->card;
2745+
const struct mwifiex_pcie_card_reg *reg = card->pcie.reg;
2746+
2747+
if (reg->sleep_cookie)
2748+
mwifiex_pcie_delete_sleep_cookie_buf(adapter);
2749+
2750+
mwifiex_pcie_delete_cmdrsp_buf(adapter);
2751+
mwifiex_pcie_delete_evtbd_ring(adapter);
2752+
mwifiex_pcie_delete_rxbd_ring(adapter);
2753+
mwifiex_pcie_delete_txbd_ring(adapter);
2754+
card->cmdrsp_buf = NULL;
2755+
}
2756+
27422757
/*
27432758
* This function initializes the PCI-E host memory space, WCB rings, etc.
27442759
*
@@ -2850,13 +2865,6 @@ static int mwifiex_init_pcie(struct mwifiex_adapter *adapter)
28502865

28512866
/*
28522867
* This function cleans up the allocated card buffers.
2853-
*
2854-
* The following are freed by this function -
2855-
* - TXBD ring buffers
2856-
* - RXBD ring buffers
2857-
* - Event BD ring buffers
2858-
* - Command response ring buffer
2859-
* - Sleep cookie buffer
28602868
*/
28612869
static void mwifiex_cleanup_pcie(struct mwifiex_adapter *adapter)
28622870
{
@@ -2875,6 +2883,8 @@ static void mwifiex_cleanup_pcie(struct mwifiex_adapter *adapter)
28752883
"Failed to write driver not-ready signature\n");
28762884
}
28772885

2886+
mwifiex_pcie_free_buffers(adapter);
2887+
28782888
if (pdev) {
28792889
pci_iounmap(pdev, card->pci_mmap);
28802890
pci_iounmap(pdev, card->pci_mmap1);
@@ -3126,10 +3136,7 @@ static void mwifiex_pcie_up_dev(struct mwifiex_adapter *adapter)
31263136
pci_iounmap(pdev, card->pci_mmap1);
31273137
}
31283138

3129-
/* This function cleans up the PCI-E host memory space.
3130-
* Some code is extracted from mwifiex_unregister_dev()
3131-
*
3132-
*/
3139+
/* This function cleans up the PCI-E host memory space. */
31333140
static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter)
31343141
{
31353142
struct pcie_service_card *card = adapter->card;
@@ -3140,14 +3147,7 @@ static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter)
31403147

31413148
adapter->seq_num = 0;
31423149

3143-
if (reg->sleep_cookie)
3144-
mwifiex_pcie_delete_sleep_cookie_buf(adapter);
3145-
3146-
mwifiex_pcie_delete_cmdrsp_buf(adapter);
3147-
mwifiex_pcie_delete_evtbd_ring(adapter);
3148-
mwifiex_pcie_delete_rxbd_ring(adapter);
3149-
mwifiex_pcie_delete_txbd_ring(adapter);
3150-
card->cmdrsp_buf = NULL;
3150+
mwifiex_pcie_free_buffers(adapter);
31513151
}
31523152

31533153
static struct mwifiex_if_ops pcie_ops = {

0 commit comments

Comments
 (0)