diff options
author | André Goddard Rosa <andre.goddard@gmail.com> | 2009-05-30 01:13:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-30 01:13:58 -0400 |
commit | 342a437ef625953e8bdeee3bc1605ccd27a38863 (patch) | |
tree | d27e11745942803b94bc459e601a1c3917a09361 /drivers | |
parent | 644233073458653e4b7fb474d9a8bdbbfd37739a (diff) |
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/rtl8150.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index f9fb454ffa8b..fcc6fa0905d1 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c | |||
@@ -221,7 +221,8 @@ static void ctrl_callback(struct urb *urb) | |||
221 | case -ENOENT: | 221 | case -ENOENT: |
222 | break; | 222 | break; |
223 | default: | 223 | default: |
224 | dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status); | 224 | if (printk_ratelimit()) |
225 | dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status); | ||
225 | } | 226 | } |
226 | dev = urb->context; | 227 | dev = urb->context; |
227 | clear_bit(RX_REG_SET, &dev->flags); | 228 | clear_bit(RX_REG_SET, &dev->flags); |
@@ -442,10 +443,12 @@ static void read_bulk_callback(struct urb *urb) | |||
442 | case -ENOENT: | 443 | case -ENOENT: |
443 | return; /* the urb is in unlink state */ | 444 | return; /* the urb is in unlink state */ |
444 | case -ETIME: | 445 | case -ETIME: |
445 | dev_warn(&urb->dev->dev, "may be reset is needed?..\n"); | 446 | if (printk_ratelimit()) |
447 | dev_warn(&urb->dev->dev, "may be reset is needed?..\n"); | ||
446 | goto goon; | 448 | goto goon; |
447 | default: | 449 | default: |
448 | dev_warn(&urb->dev->dev, "Rx status %d\n", status); | 450 | if (printk_ratelimit()) |
451 | dev_warn(&urb->dev->dev, "Rx status %d\n", status); | ||
449 | goto goon; | 452 | goto goon; |
450 | } | 453 | } |
451 | 454 | ||