1 From: Michal Kazior <michal.kazior@tieto.com>
2 Date: Tue, 17 May 2016 14:47:01 +0200
3 Subject: [PATCH] ath10k: disable wake_tx_queue for older devices
5 Some setups suffer performance regressions with
6 current wake_tx_queue implementation.
8 Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
11 --- a/drivers/net/wireless/ath/ath10k/core.h
12 +++ b/drivers/net/wireless/ath/ath10k/core.h
13 @@ -667,6 +667,7 @@ struct ath10k_fw_components {
15 struct ath_common ath_common;
16 struct ieee80211_hw *hw;
17 + struct ieee80211_ops *ops;
19 u8 mac_addr[ETH_ALEN];
21 --- a/drivers/net/wireless/ath/ath10k/mac.c
22 +++ b/drivers/net/wireless/ath/ath10k/mac.c
23 @@ -7497,21 +7497,32 @@ static const struct ieee80211_channel at
24 struct ath10k *ath10k_mac_create(size_t priv_size)
26 struct ieee80211_hw *hw;
27 + struct ieee80211_ops *ops;
30 - hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, &ath10k_ops);
32 + ops = kmemdup(&ath10k_ops, sizeof(ath10k_ops), GFP_KERNEL);
36 + hw = ieee80211_alloc_hw(sizeof(struct ath10k) + priv_size, ops);
49 void ath10k_mac_destroy(struct ath10k *ar)
51 + struct ieee80211_ops *ops = ar->ops;
53 ieee80211_free_hw(ar->hw);
57 static const struct ieee80211_iface_limit ath10k_if_limits[] = {
58 @@ -7945,6 +7956,15 @@ int ath10k_mac_register(struct ath10k *a
59 ath10k_warn(ar, "failed to initialise DFS pattern detector\n");
62 + /* Current wake_tx_queue implementation imposes a significant
63 + * performance penalty in some setups. The tx scheduling code needs
64 + * more work anyway so disable the wake_tx_queue unless firmware
65 + * supports the pull-push mechanism.
67 + if (!test_bit(ATH10K_FW_FEATURE_PEER_FLOW_CONTROL,
68 + ar->running_fw->fw_file.fw_features))
69 + ar->ops->wake_tx_queue = NULL;
71 ret = ath_regd_init(&ar->ath_common.regulatory, ar->hw->wiphy,