ALSA: usb-audio: Don't use printk_ratelimit for debug prints
authorSean Anderson <sean.anderson@linux.dev>
Fri, 1 Aug 2025 15:47:10 +0000 (11:47 -0400)
committerTakashi Iwai <tiwai@suse.de>
Sat, 2 Aug 2025 14:17:50 +0000 (16:17 +0200)
printk_ratelimit is deprecated, since it shares state with all other
printk sites. Additionally, the suppression message is printed at
warning level even though the actual messages are printed at debug and
are (usually) invisible! This can result in thousands of messages like

retire_capture_urb: 4992 callbacks suppressed

in the console, and can inhibit debugging since it is unclear what the
source of the suppressed callbacks is.

Switch to dev_dbg_ratelimited which doesn't print anything unless debug
is enabled.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Link: https://patch.msgid.link/20250801154710.739464-1-sean.anderson@linux.dev
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/pcm.c

index b24ee38fad7203fd73150d51cdf6b2e9163b3077..bff92505e4083458c98044a3e6db2a4d945e07c6 100644 (file)
@@ -1336,11 +1336,10 @@ static void 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 + subs->pkt_offset_adj;
-               if (urb->iso_frame_desc[i].status && printk_ratelimit()) {
-                       dev_dbg(&subs->dev->dev, "frame %d active: %d\n",
-                               i, urb->iso_frame_desc[i].status);
-                       // continue;
-               }
+               if (urb->iso_frame_desc[i].status)
+                       dev_dbg_ratelimited(&subs->dev->dev,
+                                           "frame %d active: %d\n", i,
+                                           urb->iso_frame_desc[i].status);
                bytes = urb->iso_frame_desc[i].actual_length;
                if (subs->stream_offset_adj > 0) {
                        unsigned int adj = min(subs->stream_offset_adj, bytes);