From owner-freebsd-current Sun Jan 9 22: 3: 2 2000 Delivered-To: freebsd-current@freebsd.org Received: from overcee.netplex.com.au (overcee.netplex.com.au [202.12.86.7]) by hub.freebsd.org (Postfix) with ESMTP id DE19A14C5A; Sun, 9 Jan 2000 22:02:48 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by overcee.netplex.com.au (Postfix) with ESMTP id 95C301CC6; Mon, 10 Jan 2000 14:02:42 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.1.1 10/15/1999 To: Jun Kuriyama Cc: current@FreeBSD.org, cg@FreeBSD.org Subject: Re: NeoMagic 256AV Audio Driver In-Reply-To: Message from Jun Kuriyama of "Mon, 10 Jan 2000 14:46:32 +0900." <14457.29240.569082.29321F@localhost.sky.rim.or.jp> Date: Mon, 10 Jan 2000 14:02:42 +0800 From: Peter Wemm Message-Id: <20000110060242.95C301CC6@overcee.netplex.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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