From: Takashi Iwai Date: Mon, 9 Jan 2012 10:37:20 +0000 (+0100) Subject: ALSA: usb-audio - Avoid flood of frame-active debug messages X-Git-Tag: v3.2.2~118 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b4133832cf270a39c961edf9777d2187eb2b7977;p=karo-tx-linux.git ALSA: usb-audio - Avoid flood of frame-active debug messages commit 80c8a2a372599e604b04a9c568952fe39cd1851d upstream. With some buggy devices, the usb-audio driver may give "frame xxx active" kernel messages too often. Better to keep it as debug-only using snd_printdd(), and also add the rate-limit for avoiding floods. Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=738681 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 81c6edecd862..08dcce53720b 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -458,8 +459,8 @@ static int retire_capture_urb(struct snd_usb_substream *subs, for (i = 0; i < urb->number_of_packets; i++) { cp = (unsigned char *)urb->transfer_buffer + urb->iso_frame_desc[i].offset; - if (urb->iso_frame_desc[i].status) { - snd_printd(KERN_ERR "frame %d active: %d\n", i, urb->iso_frame_desc[i].status); + if (urb->iso_frame_desc[i].status && printk_ratelimit()) { + snd_printdd("frame %d active: %d\n", i, urb->iso_frame_desc[i].status); // continue; } bytes = urb->iso_frame_desc[i].actual_length;