Commit d4187449 authored by Takashi Iwai's avatar Takashi Iwai Committed by Kleber Sacilotto de Souza

ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback

BugLink: https://bugs.launchpad.net/bugs/1791953

[ Upstream commit 377a879d ]

retire_capture_urb() may print warning messages when the given URB
doesn't align, and this may flood the system log easily.
Put the rate limit to the message for avoiding it.

Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1093485Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent fda1cb2e
...@@ -1300,7 +1300,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs, ...@@ -1300,7 +1300,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs,
if (bytes % (runtime->sample_bits >> 3) != 0) { if (bytes % (runtime->sample_bits >> 3) != 0) {
int oldbytes = bytes; int oldbytes = bytes;
bytes = frames * stride; bytes = frames * stride;
dev_warn(&subs->dev->dev, dev_warn_ratelimited(&subs->dev->dev,
"Corrected urb data len. %d->%d\n", "Corrected urb data len. %d->%d\n",
oldbytes, bytes); oldbytes, bytes);
} }
......
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