Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -221,6 +221,7 @@ static void ctrl_callback(struct urb *urb)
	case -ENOENT:
		break;
	default:
		if (printk_ratelimit())
			dev_warn(&urb->dev->dev, "ctrl urb status %d\n", status);
	}
	dev = urb->context;
@@ -442,9 +443,11 @@ static void read_bulk_callback(struct urb *urb)
	case -ENOENT:
		return;	/* the urb is in unlink state */
	case -ETIME:
		if (printk_ratelimit())
			dev_warn(&urb->dev->dev, "may be reset is needed?..\n");
		goto goon;
	default:
		if (printk_ratelimit())
			dev_warn(&urb->dev->dev, "Rx status %d\n", status);
		goto goon;
	}