Update of /cvsroot/alsa/alsa-kernel/ppc
In directory sc8-pr-cvs1:/tmp/cvs-serv7766
Modified Files:
burgundy.c
Log Message:
added the timeout for busy loop.
Index: burgundy.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/ppc/burgundy.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- burgundy.c 16 Aug 2002 15:08:49 -0000 1.10
+++ burgundy.c 17 Jul 2003 16:56:49 -0000 1.11
@@ -23,6 +23,7 @@
#include <asm/io.h>
#include <linux/init.h>
#include <linux/slab.h>
+#include <linux/delay.h>
#include <sound/core.h>
#include "pmac.h"
#include "burgundy.h"
@@ -34,17 +35,27 @@
inline static void
snd_pmac_burgundy_busy_wait(pmac_t *chip)
{
- while (in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD)
- ;
+ int timeout = 50;
+ while ((in_le32(&chip->awacs->codec_ctrl) & MASK_NEWECMD) && timeout--)
+ udelay(1);
+ if (! timeout)
+ printk(KERN_DEBUG "burgundy_busy_wait: timeout\n");
}
inline static void
snd_pmac_burgundy_extend_wait(pmac_t *chip)
{
- while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND))
- ;
- while (in_le32(&chip->awacs->codec_stat) & MASK_EXTEND)
- ;
+ int timeout;
+ timeout = 50;
+ while (!(in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+ udelay(1);
+ if (! timeout)
+ printk(KERN_DEBUG "burgundy_extend_wait: timeout #1\n");
+ timeout = 50;
+ while ((in_le32(&chip->awacs->codec_stat) & MASK_EXTEND) && timeout--)
+ udelay(1);
+ if (! timeout)
+ printk(KERN_DEBUG "burgundy_extend_wait: timeout #2\n");
}
static void
@@ -66,7 +77,6 @@
unsigned val = 0;
unsigned long flags;
- /* should have timeouts here */
spin_lock_irqsave(&chip->reg_lock, flags);
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);
@@ -107,7 +117,6 @@
unsigned val = 0;
unsigned long flags;
- /* should have timeouts here */
spin_lock_irqsave(&chip->reg_lock, flags);
out_le32(&chip->awacs->codec_ctrl, addr + 0x100000);
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog