mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00:00
Don't push too hard waiting/looping for codec detection interrupt.
Let the interrupt do the job waking us up.
This commit is contained in:
parent
553dc5c78c
commit
79b783c721
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170720
@ -899,6 +899,7 @@ atiixp_intr(void *p)
|
|||||||
enable = atiixp_rd(sc, ATI_REG_IER);
|
enable = atiixp_rd(sc, ATI_REG_IER);
|
||||||
enable &= ~detected_codecs;
|
enable &= ~detected_codecs;
|
||||||
atiixp_wr(sc, ATI_REG_IER, enable);
|
atiixp_wr(sc, ATI_REG_IER, enable);
|
||||||
|
wakeup(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* acknowledge */
|
/* acknowledge */
|
||||||
@ -1005,18 +1006,20 @@ atiixp_chip_post_init(void *arg)
|
|||||||
polling = sc->polling;
|
polling = sc->polling;
|
||||||
sc->polling = 0;
|
sc->polling = 0;
|
||||||
|
|
||||||
/* wait for the interrupts to happen */
|
timeout = 10;
|
||||||
timeout = 100;
|
if (sc->codec_not_ready_bits == 0) {
|
||||||
do {
|
/* wait for the interrupts to happen */
|
||||||
msleep(sc, sc->lock, PWAIT, "ixpslp", 1);
|
do {
|
||||||
if (sc->codec_not_ready_bits)
|
msleep(sc, sc->lock, PWAIT, "ixpslp", max(hz / 10, 1));
|
||||||
break;
|
if (sc->codec_not_ready_bits != 0)
|
||||||
} while (--timeout);
|
break;
|
||||||
|
} while (--timeout);
|
||||||
|
}
|
||||||
|
|
||||||
sc->polling = polling;
|
sc->polling = polling;
|
||||||
atiixp_disable_interrupts(sc);
|
atiixp_disable_interrupts(sc);
|
||||||
|
|
||||||
if (timeout == 0) {
|
if (sc->codec_not_ready_bits == 0 && timeout == 0) {
|
||||||
device_printf(sc->dev,
|
device_printf(sc->dev,
|
||||||
"WARNING: timeout during codec detection; "
|
"WARNING: timeout during codec detection; "
|
||||||
"codecs might be present but haven't interrupted\n");
|
"codecs might be present but haven't interrupted\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user