Index: ds1.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pci/ds1.c,v retrieving revision 1.36 diff -u -r1.36 ds1.c --- ds1.c 2 Sep 2003 17:30:37 -0000 1.36 +++ ds1.c 15 Dec 2003 18:49:02 -0000 @@ -729,8 +729,15 @@ ds_intr(void *p) { struct sc_info *sc = (struct sc_info *)p; - u_int32_t i, x; + int i, pch, rch; + /* + * In this particular scenerio, sc->lock only protects + * against hardware access. Other immutables, like the lock itself and + * the pointers to the pcm channel structure can be accessed safely without + * the lock. + */ + pch = rch = 0; snd_mtxlock(sc->lock); i = ds_rd(sc, YDSXGR_STATUS, 4); if (i & 0x00008000) @@ -739,25 +746,26 @@ ds_wr(sc, YDSXGR_STATUS, i & 0x80008000, 4); sc->currbank = ds_rd(sc, YDSXGR_CTRLSELECT, 4) & 0x00000001; - x = 0; - for (i = 0; i < DS1_CHANS; i++) { - if (sc->pch[i].run) { - x = 1; - chn_intr(sc->pch[i].channel); - } - } - for (i = 0; i < 2; i++) { - if (sc->rch[i].run) { - x = 1; - chn_intr(sc->rch[i].channel); - } - } + for (i = 0; i < DS1_CHANS; i++) + if (sc->pch[i].run) + pch |= 1<rch[i].run) + rch |= 1<lock); + + for (i = 0; ipch[i].channel); + + for (i = 0; i<2; i++) + if ( rch & (1<rch[i].channel); } /* -------------------------------------------------------------------- */