- Fixup the locking.

- Don't mark MPSAFE (yet).

Submitted by:	Ariff Abdullah <skywizard@MyBSD.org.my>
This commit is contained in:
Alexander Leidinger 2005-07-31 13:51:04 +00:00
parent 205d75821e
commit 7a7689dea4
3 changed files with 26 additions and 4 deletions

View File

@ -138,12 +138,16 @@ ad1816_intr(void *arg)
}
/* check for capture interupt */
if (sndbuf_runsz(ad1816->rch.buffer) && (c & AD1816_INTRCI)) {
ad1816_unlock(ad1816);
chn_intr(ad1816->rch.channel);
ad1816_lock(ad1816);
served |= AD1816_INTRCI; /* cp served */
}
/* check for playback interupt */
if (sndbuf_runsz(ad1816->pch.buffer) && (c & AD1816_INTRPI)) {
ad1816_unlock(ad1816);
chn_intr(ad1816->pch.channel);
ad1816_lock(ad1816);
served |= AD1816_INTRPI; /* pb served */
}
if (served == 0) {

View File

@ -361,8 +361,11 @@ ess_intr(void *arg)
rirq = (src & sc->rch.hwch)? 1 : 0;
if (pirq) {
if (sc->pch.run)
if (sc->pch.run) {
ess_unlock(sc);
chn_intr(sc->pch.channel);
ess_lock(sc);
}
if (sc->pch.stopping) {
sc->pch.run = 0;
sndbuf_dma(sc->pch.buffer, PCMTRIG_STOP);
@ -375,8 +378,11 @@ ess_intr(void *arg)
}
if (rirq) {
if (sc->rch.run)
if (sc->rch.run) {
ess_unlock(sc);
chn_intr(sc->rch.channel);
ess_lock(sc);
}
if (sc->rch.stopping) {
sc->rch.run = 0;
sndbuf_dma(sc->rch.buffer, PCMTRIG_STOP);

View File

@ -795,11 +795,15 @@ mss_intr(void *arg)
c &= ~served;
if (sndbuf_runsz(mss->pch.buffer) && (c & 0x10)) {
served |= 0x10;
mss_unlock(mss);
chn_intr(mss->pch.channel);
mss_lock(mss);
}
if (sndbuf_runsz(mss->rch.buffer) && (c & 0x20)) {
served |= 0x20;
mss_unlock(mss);
chn_intr(mss->rch.channel);
mss_unlock(mss);
}
/* now ack the interrupt */
if (FULL_DUPLEX(mss)) ad_write(mss, 24, ~c); /* ack selectively */
@ -1111,8 +1115,16 @@ opti931_intr(void *arg)
return;
}
if (sndbuf_runsz(mss->rch.buffer) && (mc11 & 8)) chn_intr(mss->rch.channel);
if (sndbuf_runsz(mss->pch.buffer) && (mc11 & 4)) chn_intr(mss->pch.channel);
if (sndbuf_runsz(mss->rch.buffer) && (mc11 & 8)) {
mss_unlock(mss);
chn_intr(mss->rch.channel);
mss_lock(mss);
}
if (sndbuf_runsz(mss->pch.buffer) && (mc11 & 4)) {
mss_unlock(mss);
chn_intr(mss->pch.channel);
mss_lock(mss);
}
opti_wr(mss, 11, ~mc11); /* ack */
if (--loops) goto again;
mss_unlock(mss);