* [PATCH v2 01/10] ath: Add support for tracing
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 02/10] ath9k: Print RoC expiration Sujith Manoharan
` (8 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/Kconfig | 8 +++++
drivers/net/wireless/ath/Makefile | 4 +++
drivers/net/wireless/ath/ath.h | 1 +
drivers/net/wireless/ath/main.c | 3 ++
drivers/net/wireless/ath/trace.c | 20 +++++++++++
drivers/net/wireless/ath/trace.h | 71 +++++++++++++++++++++++++++++++++++++++
6 files changed, 107 insertions(+)
create mode 100644 drivers/net/wireless/ath/trace.c
create mode 100644 drivers/net/wireless/ath/trace.h
diff --git a/drivers/net/wireless/ath/Kconfig b/drivers/net/wireless/ath/Kconfig
index c63d115..ce78260 100644
--- a/drivers/net/wireless/ath/Kconfig
+++ b/drivers/net/wireless/ath/Kconfig
@@ -25,6 +25,14 @@ config ATH_DEBUG
Say Y, if you want to debug atheros wireless drivers.
Right now only ath9k makes use of this.
+config ATH_TRACEPOINTS
+ bool "Atheros wireless tracing"
+ depends on ATH_DEBUG
+ depends on EVENT_TRACING
+ ---help---
+ This option enables tracepoints for atheros wireless drivers.
+ Currently, ath9k makes use of this facility.
+
config ATH_REG_DYNAMIC_USER_REG_HINTS
bool "Atheros dynamic user regulatory hints"
depends on CFG80211_CERTIFICATION_ONUS
diff --git a/drivers/net/wireless/ath/Makefile b/drivers/net/wireless/ath/Makefile
index 7d023b0..89f8d59 100644
--- a/drivers/net/wireless/ath/Makefile
+++ b/drivers/net/wireless/ath/Makefile
@@ -17,4 +17,8 @@ ath-objs := main.o \
dfs_pri_detector.o
ath-$(CONFIG_ATH_DEBUG) += debug.o
+ath-$(CONFIG_ATH_TRACEPOINTS) += trace.o
+
ccflags-y += -D__CHECK_ENDIAN__
+
+CFLAGS_trace.o := -I$(src)
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index a3b6e27..e5ba6fa 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -268,6 +268,7 @@ enum ATH_DEBUG {
};
#define ATH_DBG_DEFAULT (ATH_DBG_FATAL)
+#define ATH_DBG_MAX_LEN 512
#ifdef CONFIG_ATH_DEBUG
diff --git a/drivers/net/wireless/ath/main.c b/drivers/net/wireless/ath/main.c
index 8b0ac14..83f47af 100644
--- a/drivers/net/wireless/ath/main.c
+++ b/drivers/net/wireless/ath/main.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include "ath.h"
+#include "trace.h"
MODULE_AUTHOR("Atheros Communications");
MODULE_DESCRIPTION("Shared library for Atheros wireless LAN cards.");
@@ -84,6 +85,8 @@ void ath_printk(const char *level, const struct ath_common* common,
else
printk("%sath: %pV", level, &vaf);
+ trace_ath_log(common->hw->wiphy, &vaf);
+
va_end(args);
}
EXPORT_SYMBOL(ath_printk);
diff --git a/drivers/net/wireless/ath/trace.c b/drivers/net/wireless/ath/trace.c
new file mode 100644
index 0000000..18fb3a0
--- /dev/null
+++ b/drivers/net/wireless/ath/trace.c
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2014 Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/module.h>
+
+#define CREATE_TRACE_POINTS
+#include "trace.h"
diff --git a/drivers/net/wireless/ath/trace.h b/drivers/net/wireless/ath/trace.h
new file mode 100644
index 0000000..ba71164
--- /dev/null
+++ b/drivers/net/wireless/ath/trace.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2014 Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#if !defined(_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_H
+
+#include <linux/tracepoint.h>
+#include "ath.h"
+
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM ath
+
+#if !defined(CONFIG_ATH_TRACEPOINTS)
+
+#undef TRACE_EVENT
+#define TRACE_EVENT(name, proto, ...) static inline void trace_ ## name(proto) {}
+
+#endif /* CONFIG_ATH_TRACEPOINTS */
+
+TRACE_EVENT(ath_log,
+
+ TP_PROTO(struct wiphy *wiphy,
+ struct va_format *vaf),
+
+ TP_ARGS(wiphy, vaf),
+
+ TP_STRUCT__entry(
+ __string(device, wiphy_name(wiphy))
+ __string(driver, KBUILD_MODNAME)
+ __dynamic_array(char, msg, ATH_DBG_MAX_LEN)
+ ),
+
+ TP_fast_assign(
+ __assign_str(device, wiphy_name(wiphy));
+ __assign_str(driver, KBUILD_MODNAME);
+ WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
+ ATH_DBG_MAX_LEN,
+ vaf->fmt,
+ *vaf->va) >= ATH_DBG_MAX_LEN);
+ ),
+
+ TP_printk(
+ "%s %s %s",
+ __get_str(driver),
+ __get_str(device),
+ __get_str(msg)
+ )
+);
+
+#endif /* _TRACE_H || TRACE_HEADER_MULTI_READ */
+
+#undef TRACE_INCLUDE_PATH
+#define TRACE_INCLUDE_PATH .
+#undef TRACE_INCLUDE_FILE
+#define TRACE_INCLUDE_FILE trace
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 02/10] ath9k: Print RoC expiration
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 01/10] ath: Add support for tracing Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 03/10] ath9k: Check pending frames properly Sujith Manoharan
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/channel.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index b93f83c..d088f06 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -761,6 +761,13 @@ void ath_offchannel_next(struct ath_softc *sc)
void ath_roc_complete(struct ath_softc *sc, bool abort)
{
+ struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+
+ if (abort)
+ ath_dbg(common, CHAN_CTX, "RoC aborted\n");
+ else
+ ath_dbg(common, CHAN_CTX, "RoC expired\n");
+
sc->offchannel.roc_vif = NULL;
sc->offchannel.roc_chan = NULL;
if (!abort)
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 03/10] ath9k: Check pending frames properly
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 01/10] ath: Add support for tracing Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 02/10] ath9k: Print RoC expiration Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 04/10] ath9k: Fix pending frame check Sujith Manoharan
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
There is no need to check if the current
channel context has active ACs queued up
if the TX queue is not empty.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index ae7c6ee..84c0cd4 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -60,8 +60,10 @@ static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq)
spin_lock_bh(&txq->axq_lock);
- if (txq->axq_depth)
+ if (txq->axq_depth) {
pending = true;
+ goto out;
+ }
if (txq->mac80211_qnum >= 0) {
struct list_head *list;
@@ -70,6 +72,7 @@ static bool ath9k_has_pending_frames(struct ath_softc *sc, struct ath_txq *txq)
if (!list_empty(list))
pending = true;
}
+out:
spin_unlock_bh(&txq->axq_lock);
return pending;
}
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 04/10] ath9k: Fix pending frame check
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (2 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 03/10] ath9k: Check pending frames properly Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 05/10] ath9k: Remove duplicate code Sujith Manoharan
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Checking for the queue depth outside of
the TX queue lock is incorrect and in this
case, is not required since it is done inside
ath9k_has_pending_frames().
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 84c0cd4..73a4438 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1974,9 +1974,6 @@ static bool ath9k_has_tx_pending(struct ath_softc *sc)
if (!ATH_TXQ_SETUP(sc, i))
continue;
- if (!sc->tx.txq[i].axq_depth)
- continue;
-
npend = ath9k_has_pending_frames(sc, &sc->tx.txq[i]);
if (npend)
break;
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 05/10] ath9k: Remove duplicate code
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (3 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 04/10] ath9k: Fix pending frame check Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 06/10] ath9k: Fix queue handling in flush() Sujith Manoharan
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
ath9k_has_tx_pending() can be used to
check if there are pending frames instead
of having duplicate code.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/main.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 73a4438..65ca7ac 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2039,16 +2039,8 @@ void __ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
static bool ath9k_tx_frames_pending(struct ieee80211_hw *hw)
{
struct ath_softc *sc = hw->priv;
- int i;
-
- for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
- if (!ATH_TXQ_SETUP(sc, i))
- continue;
- if (ath9k_has_pending_frames(sc, &sc->tx.txq[i]))
- return true;
- }
- return false;
+ return ath9k_has_tx_pending(sc);
}
static int ath9k_tx_last_beacon(struct ieee80211_hw *hw)
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 06/10] ath9k: Fix queue handling in flush()
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (4 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 05/10] ath9k: Remove duplicate code Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 07/10] ath9k: Pass context to ath9k_chanctx_wake_queues() Sujith Manoharan
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
When draining of the TX queues fails, a
full HW reset is done. ath_reset() makes sure
that the queues in mac80211 are restarted,
so there is no need to wake them up again.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/main.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 65ca7ac..5f908a0 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1999,7 +1999,6 @@ void __ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
struct ath_common *common = ath9k_hw_common(ah);
int timeout = HZ / 5; /* 200 ms */
bool drain_txq;
- int i;
cancel_delayed_work_sync(&sc->tx_complete_work);
@@ -2027,10 +2026,6 @@ void __ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
ath_reset(sc);
ath9k_ps_restore(sc);
- for (i = 0; i < IEEE80211_NUM_ACS; i++) {
- ieee80211_wake_queue(sc->hw,
- sc->cur_chan->hw_queue_base + i);
- }
}
ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 07/10] ath9k: Pass context to ath9k_chanctx_wake_queues()
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (5 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 06/10] ath9k: Fix queue handling in flush() Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 08/10] ath9k: Add ath9k_chanctx_stop_queues() Sujith Manoharan
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Change the ath9k_chanctx_wake_queues() API so
that we can pass the channel context that needs its
queues to be stopped.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 5 +++--
drivers/net/wireless/ath/ath9k/channel.c | 6 +++---
drivers/net/wireless/ath/ath9k/main.c | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 37a5ccf..4f94d31 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -455,7 +455,7 @@ void ath9k_p2p_bss_info_changed(struct ath_softc *sc,
void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
struct sk_buff *skb);
void ath9k_p2p_ps_timer(void *priv);
-void ath9k_chanctx_wake_queues(struct ath_softc *sc);
+void ath9k_chanctx_wake_queues(struct ath_softc *sc, struct ath_chanctx *ctx);
void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx);
void ath_chanctx_beacon_recv_ev(struct ath_softc *sc,
@@ -525,7 +525,8 @@ static inline void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *av
static inline void ath9k_p2p_ps_timer(struct ath_softc *sc)
{
}
-static inline void ath9k_chanctx_wake_queues(struct ath_softc *sc)
+static inline void ath9k_chanctx_wake_queues(struct ath_softc *sc,
+ struct ath_chanctx *ctx)
{
}
static inline void ath_chanctx_check_active(struct ath_softc *sc,
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index d088f06..96da03e 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1177,18 +1177,18 @@ bool ath9k_is_chanctx_enabled(void)
/* Queue management */
/********************/
-void ath9k_chanctx_wake_queues(struct ath_softc *sc)
+void ath9k_chanctx_wake_queues(struct ath_softc *sc, struct ath_chanctx *ctx)
{
struct ath_hw *ah = sc->sc_ah;
int i;
- if (sc->cur_chan == &sc->offchannel.chan) {
+ if (ctx == &sc->offchannel.chan) {
ieee80211_wake_queue(sc->hw,
sc->hw->offchannel_tx_hw_queue);
} else {
for (i = 0; i < IEEE80211_NUM_ACS; i++)
ieee80211_wake_queue(sc->hw,
- sc->cur_chan->hw_queue_base + i);
+ ctx->hw_queue_base + i);
}
if (ah->opmode == NL80211_IFTYPE_AP)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 5f908a0..f0035a9 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -268,7 +268,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
if (!ath9k_is_chanctx_enabled())
ieee80211_wake_queues(sc->hw);
else
- ath9k_chanctx_wake_queues(sc);
+ ath9k_chanctx_wake_queues(sc, sc->cur_chan);
ath9k_p2p_ps_timer(sc);
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 08/10] ath9k: Add ath9k_chanctx_stop_queues()
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (6 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 07/10] ath9k: Pass context to ath9k_chanctx_wake_queues() Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 09/10] ath9k: Fix queue handling for channel contexts Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 10/10] ath9k: Fix flushing in MCC mode Sujith Manoharan
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
This can be used when the queues of a context
needs to be stopped.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/ath9k.h | 5 +++++
drivers/net/wireless/ath/ath9k/channel.c | 19 +++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 4f94d31..bfa0b15 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -456,6 +456,7 @@ void ath9k_beacon_add_noa(struct ath_softc *sc, struct ath_vif *avp,
struct sk_buff *skb);
void ath9k_p2p_ps_timer(void *priv);
void ath9k_chanctx_wake_queues(struct ath_softc *sc, struct ath_chanctx *ctx);
+void ath9k_chanctx_stop_queues(struct ath_softc *sc, struct ath_chanctx *ctx);
void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx);
void ath_chanctx_beacon_recv_ev(struct ath_softc *sc,
@@ -529,6 +530,10 @@ static inline void ath9k_chanctx_wake_queues(struct ath_softc *sc,
struct ath_chanctx *ctx)
{
}
+static inline void ath9k_chanctx_stop_queues(struct ath_softc *sc,
+ struct ath_chanctx *ctx)
+{
+}
static inline void ath_chanctx_check_active(struct ath_softc *sc,
struct ath_chanctx *ctx)
{
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 96da03e..bf5ecd8 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1177,6 +1177,25 @@ bool ath9k_is_chanctx_enabled(void)
/* Queue management */
/********************/
+void ath9k_chanctx_stop_queues(struct ath_softc *sc, struct ath_chanctx *ctx)
+{
+ struct ath_hw *ah = sc->sc_ah;
+ int i;
+
+ if (ctx == &sc->offchannel.chan) {
+ ieee80211_stop_queue(sc->hw,
+ sc->hw->offchannel_tx_hw_queue);
+ } else {
+ for (i = 0; i < IEEE80211_NUM_ACS; i++)
+ ieee80211_stop_queue(sc->hw,
+ ctx->hw_queue_base + i);
+ }
+
+ if (ah->opmode == NL80211_IFTYPE_AP)
+ ieee80211_stop_queue(sc->hw, sc->hw->queues - 2);
+}
+
+
void ath9k_chanctx_wake_queues(struct ath_softc *sc, struct ath_chanctx *ctx)
{
struct ath_hw *ah = sc->sc_ah;
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 09/10] ath9k: Fix queue handling for channel contexts
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (7 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 08/10] ath9k: Add ath9k_chanctx_stop_queues() Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
2014-10-02 1:03 ` [PATCH v2 10/10] ath9k: Fix flushing in MCC mode Sujith Manoharan
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
When a full chip reset is done, all the queues
across all VIFs are stopped, but if MCC is enabled,
only the queues of the current context is awakened,
when we complete the reset.
This results in unfairness for the inactive context.
Since frames are queued internally in the driver if
there is a context mismatch, we can awaken all the
queues when coming out of a reset.
The VIF-specific queues are still used in flow control,
to ensure fairness when traffic is high.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/main.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index f0035a9..2051624 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -264,12 +264,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
ath9k_hw_set_interrupts(ah);
ath9k_hw_enable_interrupts(ah);
-
- if (!ath9k_is_chanctx_enabled())
- ieee80211_wake_queues(sc->hw);
- else
- ath9k_chanctx_wake_queues(sc, sc->cur_chan);
-
+ ieee80211_wake_queues(sc->hw);
ath9k_p2p_ps_timer(sc);
return true;
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH v2 10/10] ath9k: Fix flushing in MCC mode
2014-10-02 1:03 [PATCH v2 00/10] ath9k patches Sujith Manoharan
` (8 preceding siblings ...)
2014-10-02 1:03 ` [PATCH v2 09/10] ath9k: Fix queue handling for channel contexts Sujith Manoharan
@ 2014-10-02 1:03 ` Sujith Manoharan
9 siblings, 0 replies; 12+ messages in thread
From: Sujith Manoharan @ 2014-10-02 1:03 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless, ath9k-devel
From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
When we are attempting to switch to a new
channel context, the TX queues are flushed, but
the mac80211 queues are not stopped and traffic
can still come down to the driver.
This patch fixes it by stopping the queues
assigned to the current context/vif before
trying to flush.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath9k/channel.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index bf5ecd8..945c898 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1044,9 +1044,11 @@ static void ath_offchannel_channel_change(struct ath_softc *sc)
void ath_chanctx_set_next(struct ath_softc *sc, bool force)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
+ struct ath_chanctx *old_ctx;
struct timespec ts;
bool measure_time = false;
bool send_ps = false;
+ bool queues_stopped = false;
spin_lock_bh(&sc->chan_lock);
if (!sc->next_chan) {
@@ -1076,6 +1078,10 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
getrawmonotonic(&ts);
measure_time = true;
}
+
+ ath9k_chanctx_stop_queues(sc, sc->cur_chan);
+ queues_stopped = true;
+
__ath9k_flush(sc->hw, ~0, true);
if (ath_chanctx_send_ps_frame(sc, true))
@@ -1089,6 +1095,7 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
sc->cur_chan->tsf_val = ath9k_hw_gettsf64(sc->sc_ah);
}
}
+ old_ctx = sc->cur_chan;
sc->cur_chan = sc->next_chan;
sc->cur_chan->stopped = false;
sc->next_chan = NULL;
@@ -1111,7 +1118,16 @@ void ath_chanctx_set_next(struct ath_softc *sc, bool force)
if (measure_time)
sc->sched.channel_switch_time =
ath9k_hw_get_tsf_offset(&ts, NULL);
+ /*
+ * A reset will ensure that all queues are woken up,
+ * so there is no need to awaken them again.
+ */
+ goto out;
}
+
+ if (queues_stopped)
+ ath9k_chanctx_wake_queues(sc, old_ctx);
+out:
if (send_ps)
ath_chanctx_send_ps_frame(sc, false);
--
2.1.1
^ permalink raw reply related [flat|nested] 12+ messages in thread