ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.
authorBen Greear <greearb@candelatech.com>
Mon, 6 Dec 2010 21:13:07 +0000 (13:13 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 7 Dec 2010 21:54:24 +0000 (16:54 -0500)
This decreases spammage in the log.  A single line message
will still be printed, so users can be aware that problem
exists.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/ath9k/recv.c

index dd78ad13ea030db6b03623b0acdaaad0db4c3014..272dfef254531fb954b6dcb68d31cde15d31a263 100644 (file)
@@ -267,6 +267,7 @@ enum ATH_DEBUG {
        rtn;                                                    \
 })
 #define ATH_DBG_WARN(foo, arg...) WARN(foo, arg)
+#define ATH_DBG_WARN_ON_ONCE(foo) WARN_ON_ONCE(foo)
 
 #else
 
@@ -277,6 +278,7 @@ ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
        return 0;
 }
 #define ATH_DBG_WARN(foo, arg...) do {} while (0)
+#define ATH_DBG_WARN_ON_ONCE(foo) do {} while (0)
 
 #endif /* CONFIG_ATH_DEBUG */
 
index 70f3fa69c9a4dc0b97847ad9bb9dd6e566e1bc0b..3f8b2e32f36477e1d6e8539df0d2cc63053985b3 100644 (file)
@@ -528,8 +528,12 @@ bool ath_stoprecv(struct ath_softc *sc)
                sc->rx.rxlink = NULL;
        spin_unlock_bh(&sc->rx.rxbuflock);
 
-       ATH_DBG_WARN(!stopped, "Could not stop RX, we could be "
-                    "confusing the DMA engine when we start RX up\n");
+       if (unlikely(!stopped)) {
+               ath_err(ath9k_hw_common(sc->sc_ah),
+                       "Could not stop RX, we could be "
+                       "confusing the DMA engine when we start RX up\n");
+               ATH_DBG_WARN_ON_ONCE(!stopped);
+       }
        return stopped;
 }