Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2000 14:02:42 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Jun Kuriyama <kuriyama@sky.rim.or.jp>
Cc:        current@FreeBSD.org, cg@FreeBSD.org
Subject:   Re: NeoMagic 256AV Audio Driver 
Message-ID:  <20000110060242.95C301CC6@overcee.netplex.com.au>
In-Reply-To: Message from Jun Kuriyama <kuriyama@sky.rim.or.jp>  of "Mon, 10 Jan 2000 14:46:32 %2B0900." <14457.29240.569082.29321F@localhost.sky.rim.or.jp> 

next in thread | previous in thread | raw e-mail | index | archive | help
Jun Kuriyama wrote:
> 
> New pcm driver found my NeoMagic 256AV's sound device.  Great!  But in 
> my configuration, pcm0 complains many "pcm0: 1000 bad intrs" on console.

This is a bug in neomagic.c and is probably due to you having a shared
interrupt..

Suggested fix:

Index: neomagic.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/sound/pci/neomagic.c,v
retrieving revision 1.2
diff -u -r1.2 neomagic.c
--- neomagic.c	2000/01/10 01:59:12	1.2
+++ neomagic.c	2000/01/10 06:01:17
@@ -68,7 +68,7 @@
 	u_int32_t 	ac97_base, ac97_status, ac97_busy;
 	u_int32_t	buftop, pbuf, rbuf, cbuf, acbuf;
 	u_int32_t	playint, recint, misc1int, misc2int;
-	u_int32_t	irsz, badintr;
+	u_int32_t	irsz;
 
 	struct sc_chinfo pch, rch;
 };
@@ -431,14 +431,8 @@
 	int status, x;
 
 	status = nm_rd(sc, NM_INT_REG, sc->irsz);
-	if (status == 0) {
-		if (sc->badintr++ > 1000) {
-			device_printf(sc->dev, "1000 bad intrs\n");
-			sc->badintr = 0;
-		}
+	if (status == 0)
 		return;
-	}
-	sc->badintr = 0;
 
 	if (status & sc->playint) {
 		status &= ~sc->playint;
@@ -507,7 +501,6 @@
 		sc->misc1int = NM2_MISC_INT_1;
 		sc->misc2int = NM2_MISC_INT_2;
 	}
-	sc->badintr = 0;
 	ofs = sc->buftop - 0x0400;
 	sc->buftop -= 0x1400;

The reason is simple..  when a shared level-sensitive interrupt is triggered,
all of the interrupt handlers are called.  They have to check their hardware
and ask "was this interrupt my responsibility?" and stop immediately if not. 

Cheers,
-Peter




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000110060242.95C301CC6>