mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Harish K Harshan <harish@amritapuri.amrita.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Interrupt Handling in linux
Date: Fri, 9 Jul 2004 08:18:22 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.53.0407090808130.919@chaos> (raw)
In-Reply-To: <40916.203.197.150.195.1089366068.squirrel@203.197.150.195>

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.



      parent reply	other threads:[~2004-07-09 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-09  9:41 Harish K Harshan
2004-07-09 10:34 ` Sylvain Munaut
2004-07-09 12:18 ` Richard B. Johnson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.53.0407090808130.919@chaos \
    --to=root@chaos.analogic.com \
    --cc=harish@amritapuri.amrita.edu \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®