aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorAriff Abdullah <ariff@FreeBSD.org>2007-06-14 11:11:06 +0000
committerAriff Abdullah <ariff@FreeBSD.org>2007-06-14 11:11:06 +0000
commit79b783c7219cbee39081a03b549d8e8fefadbf55 (patch)
treed94fe7061912d599f0f3e3651958d5402a809918 /sys/dev/sound
parent553dc5c78cc8d94590eb5528444e9900cbc0ade0 (diff)
Notes
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pci/atiixp.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sys/dev/sound/pci/atiixp.c b/sys/dev/sound/pci/atiixp.c
index 1b325ef8b44d8..58d99ae4d5f72 100644
--- a/sys/dev/sound/pci/atiixp.c
+++ b/sys/dev/sound/pci/atiixp.c
@@ -899,6 +899,7 @@ atiixp_intr(void *p)
enable = atiixp_rd(sc, ATI_REG_IER);
enable &= ~detected_codecs;
atiixp_wr(sc, ATI_REG_IER, enable);
+ wakeup(sc);
}
/* acknowledge */
@@ -1005,18 +1006,20 @@ atiixp_chip_post_init(void *arg)
polling = sc->polling;
sc->polling = 0;
- /* wait for the interrupts to happen */
- timeout = 100;
- do {
- msleep(sc, sc->lock, PWAIT, "ixpslp", 1);
- if (sc->codec_not_ready_bits)
- break;
- } while (--timeout);
+ timeout = 10;
+ if (sc->codec_not_ready_bits == 0) {
+ /* wait for the interrupts to happen */
+ do {
+ msleep(sc, sc->lock, PWAIT, "ixpslp", max(hz / 10, 1));
+ if (sc->codec_not_ready_bits != 0)
+ break;
+ } while (--timeout);
+ }
sc->polling = polling;
atiixp_disable_interrupts(sc);
- if (timeout == 0) {
+ if (sc->codec_not_ready_bits == 0 && timeout == 0) {
device_printf(sc->dev,
"WARNING: timeout during codec detection; "
"codecs might be present but haven't interrupted\n");