From f31163e9671e1743d82c8527d3c695d8d26f9182 Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Sat, 7 Jun 2008 19:28:27 +0000 Subject: [PATCH] probably/hopefully fixed auich driver for many systems: note that the codec_access_semaphore will NOT be reset on certain systems if an illegal/non existing register was accessed before. We need to do the access anyway to get such systems working. I hope someone can create a more extensive entry in syslog here to identify the offending access as that can be done AFAICT. This will help improve the driver later on because the non-existing-register accesses could be removed. Anyhow: I think the change I just did should remain, as it makes the driver more fault-tolerant to faults in itself (or hardware). Lowered the wait time to 1mS btw as that should suffice big_time. My Dell Inspiron C610 laptop with ICH3-M and Crystal CS4205 now works perfectly. No sound at all before.. Fix found in Linux-2.6.17/sound/pci/intel8x0m.c. Hope no-one is offended by my 'intrusion' here. Bye. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25852 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/drivers/audio/ac97/auich/io.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/io.c b/src/add-ons/kernel/drivers/audio/ac97/auich/io.c index 3d7e25d391..714b901c23 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/io.c +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/io.c @@ -108,13 +108,19 @@ static int auich_codec_wait(device_config *config) { int i; - for (i = 0; i < 1100; i++) { + /* Anyone holding a semaphore for 1 msec should be 'shot'... */ + for (i = 0; i < 200; i++) { if ((auich_reg_read_8(config, AUICH_REG_ACC_SEMA) & 0x01) == 0) return B_OK; if (i > 100) snooze(10); } - return B_TIMED_OUT; + /* access to some forbidden (non existant) ac97 registers will not + * reset the semaphore. So even if you don't get the semaphore, still + * continue the access. We don't really need the semaphore anyway. */ + PRINT(("codec semaphore timed out!\n")); + + return B_OK; } uint16