linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Randy Oostdyk <linux-kernel@oostdyk.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: wireless dongle causing entire machine to hang
Date: Fri, 10 Aug 2018 13:14:26 +0200	[thread overview]
Message-ID: <20180810111425.GA16269@redhat.com> (raw)
In-Reply-To: <CAAemcoOkA4y7zDMCKzD+nKJAQFoWCGPVHdbEV0j9ZOeaCe144g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]

On Thu, Aug 09, 2018 at 12:49:58PM -0600, Randy Oostdyk wrote:
> On Thu, Aug 9, 2018 at 5:10 AM, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> > I'm reluctant to replace _warn by _dbg messages as if somethings
> > will go wrong we will not notice that. We can use printk_ratelimited()
> > variant instead to do not spam log in speed that it will hung
> > the machine. But the correct fix should be in USB host drivers,
> > which seems to be not in perfect shape on those embedded platforms.
> 
> Agreed about the "correct" fix likely being on the USB side, but at
> least using printk_ratelimited() will avoid the log spamming, and
> avoid locking the machine, as you said.
> 
> Will someone else take that approach and come up with a patch, or is
> this something I should try to take on myself? I could certainly test
> such a patch, if desired.
> 
> Meanwhile, I'll look into reporting the USB bug, if it hasn't already been.

I'm attaching the ratelimit patch for test. 

However after reading email from Larry I withdraw blaming USB host 
driver. The issue could be faulty HW and USB host driver can not do
much much about this. 

Another question is if machine hung due to log spam or because there
was some crash. Those error conditions trigger code paths that are
not usually used, so there could be some oops that hung the system.

Anyway you can test the patch and report back.

Cheers
Stanislaw

[-- Attachment #2: rt2x00_ratelimited_err.patch --]
[-- Type: text/plain, Size: 1197 bytes --]

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00.h b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
index 4b1744e..94459d5 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,			\

  reply	other threads:[~2018-08-10 13:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 17:58 wireless dongle causing entire machine to hang Randy Oostdyk
2018-08-08 19:04 ` Larry Finger
2018-08-08 19:14 ` Arend van Spriel
2018-08-08 21:43   ` Jonas Gorski
2018-08-09 11:10 ` Stanislaw Gruszka
2018-08-09 18:49   ` Randy Oostdyk
2018-08-10 11:14     ` Stanislaw Gruszka [this message]
2018-08-10 11:47       ` Randy Oostdyk
2018-08-15  5:19       ` Randy Oostdyk
2018-08-15  8:07         ` Stanislaw Gruszka
2018-08-16  4:25           ` Randy Oostdyk
2018-08-16 10:31             ` Stanislaw Gruszka
2018-08-16 11:02               ` Stanislaw Gruszka
2018-08-28 16:09                 ` Randy Oostdyk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180810111425.GA16269@redhat.com \
    --to=sgruszka@redhat.com \
    --cc=linux-kernel@oostdyk.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).