lkml.org 
[lkml]   [2004]   [Feb]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 13 Feb 2004 12:05:02 +0100
FromTakashi Iwai <>
SubjectRe: irq 7: nobody cared! (intel8x0 sound / 2.6.2-rc3-mm1)
At 11 Feb 2004 21:11:08 +0100,
Ralf Gerbig wrote:
> 
> -               return IRQ_NONE;  /* not for us */
> +               return IRQ_RETVAL(status);  /* not for us */

after checking the code again, using status as IRQ_RETVAL() isn't a
good way, because it has also some static status bits.
the attached patch would be better to avoid the confusion.
it will return IRQ_HANDLED only when some irq bits are really
acknowledged.


Takashi
Index: alsa-kernel/pci/intel8x0.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/pci/intel8x0.c,v
retrieving revision 1.115
diff -u -r1.115 intel8x0.c
--- alsa-kernel/pci/intel8x0.c	6 Feb 2004 17:47:49 -0000	1.115
+++ alsa-kernel/pci/intel8x0.c	13 Feb 2004 10:32:46 -0000
@@ -804,10 +804,20 @@
 	spin_lock(&chip->reg_lock);
 	status = igetdword(chip, chip->int_sta_reg);
 	if ((status & chip->int_sta_mask) == 0) {
-		if (status)
+		static int status_ack = 0;
+		static int err_count = 10;
+		if (status) {
 			iputdword(chip, chip->int_sta_reg, status);
+			status_ack = igetdword(chip, chip->int_sta_reg);
+		}
 		spin_unlock(&chip->reg_lock);
-		return IRQ_NONE;
+		status ^= status_ack;
+		if (status && err_count) {
+			err_count--;
+			snd_printd("intel8x0: unknown IRQ bits 0x%x (sta_mask=0x%x)\n",
+				   status, chip->int_sta_mask);
+		}
+		return IRQ_RETVAL(status);
 	}
 
 	for (i = 0; i < chip->bdbars_count; i++) {
\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2008