From: "André Goddard Rosa" <andre.goddard@gmail.com>
To: petkan@users.sourceforge.net
Cc: shemminger@vyatta.com, dbrownell@users.sourceforge.net,
davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH] usbnet: ratelimit warning messages invoked from callback handler
Date: Wed, 27 May 2009 13:40:44 -0300 [thread overview]
Message-ID: <b8bf37780905270940k7523d0of337111dcb80861@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 64 bytes --]
Hi,
please cc: me as I'm not subscribed.
Thank you,
Andre
[-- Attachment #2: rtl8150_ratelimit_messages.patch --]
[-- Type: text/x-diff, Size: 1652 bytes --]
commit 9db992ae115c58dc457bc2b1e6fad03252552747
Author: André Goddard Rosa <andre.goddard@gmail.com>
Date: Wed May 27 10:22:55 2009 -0300
usbnet: ratelimit warning messages invoked from callback handler
Warning messages coming from rtl8150 driver can flood the console
and make a DTV/set-top-box unable to decode video/audio frames.
'Pegasus' driver handles this situation similarly, preventing this
from happening there.
It happens with a low cost BCM MIPS embedded platform, whenever
timeout errors were coming from usbnet device, making platform
unusable for viewer watching.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c
index f9fb454..fcc6fa0 100644
--- a/drivers/net/usb/rtl8150.c
+++ b/drivers/net/usb/rtl8150.c
@@ -221,7 +221,8 @@ static void ctrl_callback(struct urb *urb)
case -ENOENT:
break;
default:
- dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status);
+ if (printk_ratelimit())
+ dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status);
}
dev = urb->context;
clear_bit(RX_REG_SET, &dev->flags);
@@ -442,10 +443,12 @@ static void read_bulk_callback(struct urb *urb)
case -ENOENT:
return; /* the urb is in unlink state */
case -ETIME:
- dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
+ if (printk_ratelimit())
+ dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
goto goon;
default:
- dev_warn(&urb->dev->dev, "Rx status %d\n", status);
+ if (printk_ratelimit())
+ dev_warn(&urb->dev->dev, "Rx status %d\n", status);
goto goon;
}
next reply other threads:[~2009-05-27 16:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-27 16:40 André Goddard Rosa [this message]
2009-05-30 5:14 ` [PATCH] usbnet: ratelimit warning messages invoked from callback handler David Miller
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=b8bf37780905270940k7523d0of337111dcb80861@mail.gmail.com \
--to=andre.goddard@gmail.com \
--cc=davem@davemloft.net \
--cc=dbrownell@users.sourceforge.net \
--cc=netdev@vger.kernel.org \
--cc=petkan@users.sourceforge.net \
--cc=shemminger@vyatta.com \
/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).