trying to fix problems people are having with commands working fine, then
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 17 Jul 2002 00:45:55 +0000 (00:45 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 17 Jul 2002 00:45:55 +0000 (00:45 +0000)
failing when interrupt is set to RT priority.

comedi/rt.c

index cec0bbfe6d123cf0a32b9e7c1d04ce7ddc98d5d9..a967ceca68474b98f6f4aa15231bfa1e51b09e9c 100644 (file)
@@ -144,6 +144,7 @@ void comedi_free_irq(unsigned int irq,void *dev_id)
 void comedi_switch_to_rt(comedi_device *dev)
 {
        struct comedi_irq_struct *it=comedi_irqs[dev->irq];
+       unsigned long flags;
 
        /* drivers might not be using an interrupt for commands */
        if(it == NULL)return;
@@ -154,22 +155,21 @@ void comedi_switch_to_rt(comedi_device *dev)
                return;
        }
 
-       spin_lock_irq(&dev->spinlock);
-       RT_protect();
-       sti();
+       comedi_spin_lock_irqsave( &dev->spinlock, flags );
 
        if(!dev->rt)
                rt_get_irq(it);
 
        dev->rt++;
        it->rt=1;
-       spin_unlock(&dev->spinlock);
-       RT_unprotect();
+
+       comedi_spin_unlock_irqrestore( &dev->spinlock, flags );
 }
 
 void comedi_switch_to_non_rt(comedi_device *dev)
 {
        struct comedi_irq_struct *it=comedi_irqs[dev->irq];
+       unsigned long flags;
 
        if(it == NULL)
                return;
@@ -178,14 +178,15 @@ void comedi_switch_to_non_rt(comedi_device *dev)
        if(it->flags & SA_SHIRQ)
                return;
 
-       RT_spin_lock_irq(&dev->spinlock);
+       comedi_spin_lock_irqsave( &dev->spinlock, flags );
 
        dev->rt--;
        if(!dev->rt)
                rt_release_irq(it);
 
        it->rt=0;
-       RT_spin_unlock_irq(&dev->spinlock);
+
+       comedi_spin_unlock_irqrestore( &dev->spinlock, flags );
 }
 
 void wake_up_int_handler(int arg1, void * arg2)