Subject: Re: TC bba audio problem on DEC3000/300
To: None <thorpej@zembu.com>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-alpha
Date: 07/18/2000 00:05:09
In <20000716214836.R585@dr-evil.z.zembu.com>
thorpej@zembu.com wrote:

> On Mon, Jul 17, 2000 at 02:04:49PM +1000, Gregory McGarry wrote:
> 
>  > You will find the term "page size" referred to all over the document.
>  > The only clue is sections 7.3.7 and 7.3.9.
> 
> ...okay.  I have committed the changes that should make this go
> on both Alpha and DECstation.  Please update:
> 
> 	sys/arch/alpha/common/bus_dma.c
> 	sys/dev/tc/bba.c
> 	sys/dev/tc/if_le_ioasic.c
> 	sys/dev/tc/ioasicreg.h
> 
> ...rebuild your kernels, and let me know how it goes.

Unfortunately, the new kernel does not work properly.
It still only plays short sound and hangs.
I tried both 1.5B and 1.5_ALPHA with some modifications,
but got the same result.

It seems that DMA transfer set up in bba_trigger_output()
is working fine but there are something wrong in bba_intr().
I put some printf() to bba_intr(), then bba_intr() is being
called eternally after the short sound.

The following patch seems to fix this and now my 3000/300 can
speak some Japanese :-) But I'm not sure how it works on pmax...

--- bba.c	Mon Jul 17 23:53:12 2000
+++ bba.c.orig	Mon Jul 17 23:52:52 2000
@@ -597,6 +597,7 @@
 	mask = bus_space_read_4(sc->sc_bst, sc->sc_bsh, IOASIC_INTR);
 
 	if (mask & IOASIC_INTR_ISDN_TXLOAD) {
+		mask &= ~IOASIC_INTR_ISDN_TXLOAD;
 		d = &sc->sc_tx_dma_state;
 		d->curseg = (d->curseg+1) % d->dmam->dm_nsegs;
 		nphys = (tc_addr_t)d->dmam->dm_segs[d->curseg].ds_addr;
@@ -606,6 +607,7 @@
 			(*d->intr)(d->intr_arg);
 	}
 	if (mask & IOASIC_INTR_ISDN_RXLOAD) {
+		mask &= ~IOASIC_INTR_ISDN_RXLOAD;
 		d = &sc->sc_rx_dma_state;
 		d->curseg = (d->curseg+1) % d->dmam->dm_nsegs;
 		nphys = (tc_addr_t)d->dmam->dm_segs[d->curseg].ds_addr;
@@ -614,6 +616,7 @@
 		if (d->intr != NULL)
 			(*d->intr)(d->intr_arg);
 	}
+	bus_space_write_4(sc->sc_bst, sc->sc_bsh, IOASIC_INTR, mask);
 
 	splx(s);
 
BTW, should bba_round_blocksize() return PAGE_SIZE or
IOASIC_DMA_BLOCKSIZE ? (I'm not familiar with audio driver...)
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp