Re: How to catch interrupt

From: Roman Kurakin <rik_at_cronyx.ru>
Date: Thu, 17 Jun 2004 21:19:36 +0400
Bruce Evans wrote:

>On Thu, 17 Jun 2004, Roman Kurakin wrote:
>  
>
>>Bruce Evans:
>>    
>>
>>>However, you may only need to test for pending interrupts.  This can
>>>be done for isa interrupts using isa_irq_pending() to get a bitmap of
>>>      
>>>
>>It seems that this function is not working for interrupts that were
>>already used
>>by some driver before I call it.
>>    
>>
>
>It only works for unacknowledged interrupts, so it can only work for
>masked interrupts.  See sio.c:
>  
>
>% 	/*
>% 	 * We don't want to get actual interrupts, just masked ones.
>% 	 * Interrupts from this line should already be masked in the ICU,
>% 	 * but mask them in the processor as well in case there are some
>% 	 * (misconfigured) shared interrupts.
>% 	 */
>% 	mtx_lock_spin(&sio_lock);
>
>Note that masking interrupts in the processor only helps for the non-SMP
>case, and the comment has rotted:
>- the code acquires a spinlock.  It only masks interrupts as a BAD side
>  effect.  In my version, acquiring a spinlock doesn't mask processor
>  interrupts, and there is an explicit intr_disable().
>- interrupts can now be shared in some non-misconfigured cases.
>  
>
So spin lock should help me in some cases but there is other cases were 
this wouldn't help or I miss
smth? In this case if some driver will acquire interrupt while probing 
and after this it will release it
(for example it will decide that this is wrong intr and will try other), 
and after we will try to load
sio driver we may fail to load it case we would unable to check this 
intr line.

rik

>Bruce
>_______________________________________________
>freebsd-current_at_freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-current
>To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
>
>
>  
>
Received on Thu Jun 17 2004 - 15:26:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:57 UTC