* Interrupt Handling in linux
@ 2004-07-09 9:41 Harish K Harshan
2004-07-09 10:34 ` Sylvain Munaut
2004-07-09 12:18 ` Richard B. Johnson
0 siblings, 2 replies; 3+ messages in thread
From: Harish K Harshan @ 2004-07-09 9:41 UTC (permalink / raw)
To: linux-kernel
Hi.
Can Interrupt handlers in linux, be interrupted by other running
processes??? to make it more clear, im developing a driver for and ADC
card, and would like to know if the CPU can or rather WILL schedule
wnother running process in the middle of the ISR, when a timer interrupt
comes in. If thats the case, then we need to use spinlocks or other
mechanisms in our ISR, right?? im new to this, so if theres something not
clear, it just just that my understanding of this topic is not very deep.
Harish.
***********************************************************************************************
Amrita Institutions, Amritapuri, Kerala, India -
Sent using Amrita Mail
Visit http://www.amrita.edu
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interrupt Handling in linux
2004-07-09 9:41 Interrupt Handling in linux Harish K Harshan
@ 2004-07-09 10:34 ` Sylvain Munaut
2004-07-09 12:18 ` Richard B. Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Sylvain Munaut @ 2004-07-09 10:34 UTC (permalink / raw)
To: Harish K Harshan; +Cc: linux-kernel
Harish K Harshan wrote:
> Hi.
>
> Can Interrupt handlers in linux, be interrupted by other running
> processes??? to make it more clear, im developing a driver for and
> ADC card, and would like to know if the CPU can or rather WILL
> schedule wnother running process in the middle of the ISR, when a
> timer interrupt comes in. If thats the case, then we need to use
> spinlocks or other mechanisms in our ISR, right?? im new to this,
> so if theres something not clear, it just just that my
> understanding of this topic is not very deep.
If you share something between an ISR and a 'not' ISR, then you should
ensure proper locking.
Look at the "kernel-locking" DocBook in linux/Documentation/DocBook
Sylvain Munaut
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Interrupt Handling in linux
2004-07-09 9:41 Interrupt Handling in linux Harish K Harshan
2004-07-09 10:34 ` Sylvain Munaut
@ 2004-07-09 12:18 ` Richard B. Johnson
1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2004-07-09 12:18 UTC (permalink / raw)
To: Harish K Harshan; +Cc: linux-kernel
On Fri, 9 Jul 2004, Harish K Harshan wrote:
> Hi.
>
> Can Interrupt handlers in linux, be interrupted by other running
> processes??? to make it more clear, im developing a driver for and ADC
> card, and would like to know if the CPU can or rather WILL schedule
> wnother running process in the middle of the ISR, when a timer interrupt
> comes in. If thats the case, then we need to use spinlocks or other
> mechanisms in our ISR, right?? im new to this, so if theres something not
> clear, it just just that my understanding of this topic is not very deep.
>
> Harish.
>
>
The usual case is that a hardware interrupt occurs, gets dispatched
by the kernel to the interrupt service routine, and is quickly
executed without interruption.
If you don't design your interrupt service code to be interrupted,
it won't be interrupted. However, another CPU may be executing
so you need to protect critical sections of code, including
your ISR, with spin-locks.
If you design your ISR to be interrupted, generally it will because,
especially on a network, there is always something that needs
interrupt service. There are so-called bottom-half handlers that
can be dispatched by your ISR to finish up what could be done
with interrupts enabled.
If your ADC board requires periodic service at a regular
interval as many do, (perhaps for an IIR filter) you might
think about writing code that executes on a timer queue,
rather than an interrupt.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
Note 96.31% of all statistics are fiction.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-07-09 12:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-09 9:41 Interrupt Handling in linux Harish K Harshan
2004-07-09 10:34 ` Sylvain Munaut
2004-07-09 12:18 ` Richard B. Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®