lkml.org 
[lkml]   [2003]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: drivers/sound/i810_audio.c bug and patch
On Thu, Sep 04, 2003 at 01:31:40AM +0200, Mehmet Ceyran wrote:
> I found out that the driver gives the sound chip 10 chances to become
> ready and my sound chip fails to do that in time. The following patch
> gives the chip 100 tries instead of 10:
>
> ---8<---
> --- i810_audio.c 2003-09-02 13:58:02.000000000 +0200
> +++ i810_audio.c.new 2003-09-02 13:58:12.000000000 +0200
> @@ -2727,7 +2727,7 @@
> i810_ac97_get(codec, AC97_POWER_CONTROL) &
> ~0x7f00);
>
> /* wait for analog ready */
> - for (i=10; i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) &
> 0xf) != 0xf); i--)
> + for (i=100; i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) &
> 0xf) != 0xf); i--)
> {
> set_current_state(TASK_UNINTERRUPTIBLE);
> schedule_timeout(HZ/20);
> --->8---
>
> Well, why not? The loop will only go through it's body 100 times if the
> hardware is actually not available or corrupt and even in this case the
> whole block won't take much time. It works for me and it should work for
> all the other people using this driver too:

Why busy wait especially when you can sleep 1ms each time and poll less?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.070 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site