2002-09-22 09:10:47

by Peter Waechtler

[permalink] [raw]
Subject: [PATCH] 6/11 sound/oss replace cli()

I left the IRQ handler as is: releasing and requesting an IRQ
handler on every frame.

--- vanilla-2.5.36/sound/oss/dmasound/dmasound_q40.c Sat Aug 10
00:03:13 2002
+++ linux-2.5-cli-oss/sound/oss/dmasound/dmasound_q40.c Sat Sep 21
18:53:15 2002
@@ -459,28 +459,32 @@
*/
return;
}
- save_flags(flags); cli();
+ spin_lock_irqsave(&dmasound.lock, flags);
Q40PlayNextFrame(1);
- restore_flags(flags);
+ spin_unlock_irqrestore_flags(&dmasound.lock, flags);
}

static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp)
{
+ spin_lock(&dmasound.lock);
if (q40_sc>1){
*DAC_LEFT=*q40_pp++;
*DAC_RIGHT=*q40_pp++;
q40_sc -=2;
master_outb(1,SAMPLE_CLEAR_REG);
}else Q40Interrupt();
+ spin_unlock(&dmasound.lock);
}
static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp)
{
+ spin_lock(&dmasound.lock);
if (q40_sc>0){
*DAC_LEFT=*q40_pp;
*DAC_RIGHT=*q40_pp++;
q40_sc --;
master_outb(1,SAMPLE_CLEAR_REG);
}else Q40Interrupt();
+ spin_unlock(&dmasound.lock);
}
static void Q40Interrupt(void)
{


2002-09-22 23:19:19

by Richard Zidlicky

[permalink] [raw]
Subject: Re: [PATCH] 6/11 sound/oss replace cli()

On Sat, Sep 21, 2002 at 10:40:08PM +0200, Peter Waechtler wrote:
> I left the IRQ handler as is: releasing and requesting an IRQ
> handler on every frame.

Thanks,
Richard

>
> --- vanilla-2.5.36/sound/oss/dmasound/dmasound_q40.c Sat Aug 10
> 00:03:13 2002
> +++ linux-2.5-cli-oss/sound/oss/dmasound/dmasound_q40.c Sat Sep 21
> 18:53:15 2002
> @@ -459,28 +459,32 @@
> */
> return;
> }
> - save_flags(flags); cli();
> + spin_lock_irqsave(&dmasound.lock, flags);
> Q40PlayNextFrame(1);
> - restore_flags(flags);
> + spin_unlock_irqrestore_flags(&dmasound.lock, flags);
> }
>
> static void Q40StereoInterrupt(int irq, void *dummy, struct pt_regs *fp)
> {
> + spin_lock(&dmasound.lock);
> if (q40_sc>1){
> *DAC_LEFT=*q40_pp++;
> *DAC_RIGHT=*q40_pp++;
> q40_sc -=2;
> master_outb(1,SAMPLE_CLEAR_REG);
> }else Q40Interrupt();
> + spin_unlock(&dmasound.lock);
> }
> static void Q40MonoInterrupt(int irq, void *dummy, struct pt_regs *fp)
> {
> + spin_lock(&dmasound.lock);
> if (q40_sc>0){
> *DAC_LEFT=*q40_pp;
> *DAC_RIGHT=*q40_pp++;
> q40_sc --;
> master_outb(1,SAMPLE_CLEAR_REG);
> }else Q40Interrupt();
> + spin_unlock(&dmasound.lock);
> }
> static void Q40Interrupt(void)
> {