Skip to content

Commit

Permalink
usbnet: ratelimit warning messages invoked from callback handler
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
andre-rosa authored and davem330 committed May 30, 2009
1 parent 6442330 commit 342a437
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/net/usb/rtl8150.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 342a437

Please sign in to comment.