2
0

021-rt2x00-use-ratelimited-variants-dev_warn-dev_err.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From patchwork Tue Mar 12 09:51:41 2019
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 7bit
  5. X-Patchwork-Submitter: Stanislaw Gruszka <[email protected]>
  6. X-Patchwork-Id: 10848959
  7. X-Patchwork-Delegate: [email protected]
  8. From: Stanislaw Gruszka <[email protected]>
  9. To: [email protected]
  10. Cc: =?utf-8?q?Tomislav_Po=C5=BEega?= <[email protected]>,
  11. Daniel Golle <[email protected]>, Felix Fietkau <[email protected]>,
  12. Mathias Kresin <[email protected]>
  13. Subject: [PATCH v3 2/4] rt2x00: use ratelimited variants dev_warn/dev_err
  14. Date: Tue, 12 Mar 2019 10:51:41 +0100
  15. Message-Id: <[email protected]>
  16. In-Reply-To: <[email protected]>
  17. References: <[email protected]>
  18. As reported by Randy we can overwhelm logs on some USB error conditions.
  19. To avoid that use dev_warn_ratelimited() and dev_err_ratelimitd().
  20. Reported-and-tested-by: Randy Oostdyk <[email protected]>
  21. Signed-off-by: Stanislaw Gruszka <[email protected]>
  22. ---
  23. drivers/net/wireless/ralink/rt2x00/rt2x00.h | 4 ++--
  24. 1 file changed, 2 insertions(+), 2 deletions(-)
  25. --- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
  26. +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
  27. @@ -69,10 +69,10 @@
  28. printk(KERN_ERR KBUILD_MODNAME ": %s: Error - " fmt, \
  29. __func__, ##__VA_ARGS__)
  30. #define rt2x00_err(dev, fmt, ...) \
  31. - wiphy_err((dev)->hw->wiphy, "%s: Error - " fmt, \
  32. + wiphy_err_ratelimited((dev)->hw->wiphy, "%s: Error - " fmt, \
  33. __func__, ##__VA_ARGS__)
  34. #define rt2x00_warn(dev, fmt, ...) \
  35. - wiphy_warn((dev)->hw->wiphy, "%s: Warning - " fmt, \
  36. + wiphy_warn_ratelimited((dev)->hw->wiphy, "%s: Warning - " fmt, \
  37. __func__, ##__VA_ARGS__)
  38. #define rt2x00_info(dev, fmt, ...) \
  39. wiphy_info((dev)->hw->wiphy, "%s: Info - " fmt, \