Commit 342a437e authored by André Goddard Rosa's avatar André Goddard Rosa Committed by David S. Miller

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: default avatarAndré Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 64423307
...@@ -221,6 +221,7 @@ static void ctrl_callback(struct urb *urb) ...@@ -221,6 +221,7 @@ static void ctrl_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
break; break;
default: default:
if (printk_ratelimit())
dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status); dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status);
} }
dev = urb->context; dev = urb->context;
...@@ -442,9 +443,11 @@ static void read_bulk_callback(struct urb *urb) ...@@ -442,9 +443,11 @@ static void read_bulk_callback(struct urb *urb)
case -ENOENT: case -ENOENT:
return; /* the urb is in unlink state */ return; /* the urb is in unlink state */
case -ETIME: case -ETIME:
if (printk_ratelimit())
dev_warn(&urb->dev->dev, "may be reset is needed?..\n"); dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
goto goon; goto goon;
default: default:
if (printk_ratelimit())
dev_warn(&urb->dev->dev, "Rx status %d\n", status); dev_warn(&urb->dev->dev, "Rx status %d\n", status);
goto goon; goto goon;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment