All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] rt2x00: use ratelimited variants dev_warn/dev_err
@ 2018-12-20 15:16 Stanislaw Gruszka
  2018-12-20 15:16 ` [PATCH v2 2/3] rt2x00: check number of EPROTO errors Stanislaw Gruszka
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Stanislaw Gruszka @ 2018-12-20 15:16 UTC (permalink / raw)
  To: linux-wireless
  Cc: Randy Oostdyk, Tomislav Požega, Daniel Golle, Felix Fietkau,
	Mathias Kresin

As reported by Randy we can overwhelm logs on some USB error conditions.
To avoid that use dev_warn_ratelimited() and dev_err_ratelimitd().

Reported-and-tested-by: Randy Oostdyk <linux-kernel@oostdyk.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2x00.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 4b1744e9fb78..94459d5ee01b 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
@@ -65,14 +65,19 @@
 /* Utility printing macros
  * rt2x00_probe_err is for messages when rt2x00_dev is uninitialized
  */
+#define wiphy_err_ratelimited(wiphy, format, args...)		\
+	dev_err_ratelimited(&(wiphy)->dev, format, ##args)
+#define wiphy_warn_ratelimited(wiphy, format, args...)		\
+	dev_warn_ratelimited(&(wiphy)->dev, format, ##args)
+
 #define rt2x00_probe_err(fmt, ...)					\
 	printk(KERN_ERR KBUILD_MODNAME ": %s: Error - " fmt,		\
 	       __func__, ##__VA_ARGS__)
 #define rt2x00_err(dev, fmt, ...)					\
-	wiphy_err((dev)->hw->wiphy, "%s: Error - " fmt,			\
+	wiphy_err_ratelimited((dev)->hw->wiphy, "%s: Error - " fmt,	\
 		  __func__, ##__VA_ARGS__)
 #define rt2x00_warn(dev, fmt, ...)					\
-	wiphy_warn((dev)->hw->wiphy, "%s: Warning - " fmt,		\
+	wiphy_warn_ratelimited((dev)->hw->wiphy, "%s: Warning - " fmt,	\
 		   __func__, ##__VA_ARGS__)
 #define rt2x00_info(dev, fmt, ...)					\
 	wiphy_info((dev)->hw->wiphy, "%s: Info - " fmt,			\
-- 
2.7.5


^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2019-03-19  2:37 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 15:16 [PATCH v2 1/3] rt2x00: use ratelimited variants dev_warn/dev_err Stanislaw Gruszka
2018-12-20 15:16 ` [PATCH v2 2/3] rt2x00: check number of EPROTO errors Stanislaw Gruszka
2019-01-07 12:47   ` Jeroen Roovers
2019-01-07 15:09     ` Stanislaw Gruszka
2019-01-08  9:30       ` Jeroen Roovers
2019-01-08 10:09         ` Jeroen Roovers
2019-01-08 11:04         ` Tom Psyborg
2019-01-09  6:17           ` Jeroen Roovers
2019-01-09 11:33             ` Stanislaw Gruszka
2019-01-10  7:49               ` Jeroen Roovers
2019-01-10 14:29                 ` Jeroen Roovers
2019-01-16 11:11                   ` Stanislaw Gruszka
2019-01-22 17:32                   ` Jeroen Roovers
2019-02-12 15:02                     ` Stanislaw Gruszka
2018-12-20 15:16 ` [PATCH v2 3/3] rt2x00: do not print error when queue is full Stanislaw Gruszka
2018-12-20 17:52   ` Tom Psyborg
2018-12-21  9:59     ` Stanislaw Gruszka
2018-12-22 13:12       ` Tom Psyborg
2018-12-25 22:43         ` Tom Psyborg
2018-12-27 10:32           ` Stanislaw Gruszka
2018-12-27 10:25         ` Stanislaw Gruszka
2018-12-28  0:45           ` Tom Psyborg
2019-01-02  8:19             ` Stanislaw Gruszka
2019-02-09 11:03               ` Stanislaw Gruszka
2019-02-09 11:11                 ` Tom Psyborg
2019-02-09 11:56                   ` Stanislaw Gruszka
2019-02-09 12:28                     ` Tom Psyborg
2019-02-09 15:38                       ` Daniel Golle
2019-02-09 16:29                         ` Tom Psyborg
2019-02-09 17:28                           ` Daniel Golle
2019-03-19  2:37                             ` Tom Psyborg
2019-02-10  9:57                       ` Stanislaw Gruszka
2018-12-21 11:19 ` [PATCH v2 1/3] rt2x00: use ratelimited variants dev_warn/dev_err Joe Perches
2018-12-21 11:57   ` Stanislaw Gruszka
2018-12-21 12:48     ` Joe Perches
2018-12-21 12:51       ` Stanislaw Gruszka
2019-01-29 12:30     ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.