Skip to contentSkip to conversation

sound/hda: rate-limit timeout message

PATCH New Randy Dunlap 1 participant 1 message Oct 31, 2005 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sound/hda: rate-limit timeout message

From: Randy Dunlap <[email protected]>

Rate-limit the azx_get_response timeout message.
A continuous 2 per second is too much.

---

 sound/pci/hda/hda_intel.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)
sound/pci/hda/hda_intel.c renamed from sound/pci/hda/hda_intel.c~hda_rate_limit +4 -1
diff -Naurp linux-2614-work/sound/pci/hda/hda_intel.c~hda_rate_limit linux-2614-work/sound/pci/hda/hda_intel.c
@@ -37,6 +37,7 @@
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
@@ -508,7 +509,9 @@ static unsigned int azx_get_response(str
 
 	while (chip->rirb.cmds) {
 		if (! --timeout) {
-			snd_printk(KERN_ERR "azx_get_response timeout\n");
+			if (printk_ratelimit())
+				snd_printk(KERN_ERR
+					"azx_get_response timeout\n");
 			chip->rirb.rp = azx_readb(chip, RIRBWP);
 			chip->rirb.cmds = 0;
 			return -1;

---