Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1657382
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: Design of interrupt controller driver |
| Date | 2017-06-05 10:30 +0200 |
| Message-ID | <tOVyH-rf-47@gated-at.bofh.it> (permalink) |
| References | <tOkz7-122-1@gated-at.bofh.it> <tOEeu-5Rg-9@gated-at.bofh.it> <tOHm2-87n-1@gated-at.bofh.it> <tOKad-1to-5@gated-at.bofh.it> <tONrr-3lC-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 5 Jun 2017, Mason wrote:
> On 04/06/2017 22:13, Thomas Gleixner wrote:
> > When you configure the interrupt as edge then you cannot share it. No
> > matter whether it stays high or not.
>
> Could you explain why? (I must be missing something.)
Device A Device B Combined Output Edge detection
Low Low 0 N
Low -> High Low 1 Y -> Interrupt handled
High Low -> High 1 N
When the A line stays high, which it does, then the edge detector will not
see a transition for B and you lose an interrupt.
> > The only way to share it is, to configure it as level interrupt. But that
> > requires that you can disable the interrupt at the DMA device level once it
> > triggered. Otherwise you get an interrupt storm.
>
> I'm not sure what you mean with "disable the interrupt at the
> DMA device level". The interrupt can be masked at the system
> interrupt controller (i.e. before sharing the interrupt
> signal). The DMA engine just outputs 0 when busy, 1 when idle.
Sharing level interrupts requires a way to disable the device (in your case
the DMA engine) interrupt output in order to prevent irq storms.
Pseudo code (locking etc. omitted):
irq_handler_devA()
{
if (!interrupt_active(devA))
return IRQ_NONE;
handle_device_irq();
if (no_more_outstanding_requests(devA)) {
reg = readl(devA->irq_control_reg);
reg &= ~DEV_IRQ_ENABLE;
writel(devA->irq_control_reg, reg);
}
return IRQ_HANDLED;
}
queue_reqeust_devA()
{
if (no_more_outstanding_requests(devA)) {
queue_request();
start_engine();
/* Reenable interrupt at device level */
reg = readl(devA->irq_control_reg);
reg |= DEV_IRQ_ENABLE;
writel(devA->irq_control_reg, reg);
} else {
queue_request();
}
}
You get the idea.
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-03 19:00 +0200
Re: Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-03 20:30 +0200
Re: Design of interrupt controller driver Thomas Gleixner <tglx@linutronix.de> - 2017-06-04 16:00 +0200
Re: Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-04 19:20 +0200
Re: Design of interrupt controller driver Thomas Gleixner <tglx@linutronix.de> - 2017-06-04 22:20 +0200
Re: Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-05 01:50 +0200
Re: Design of interrupt controller driver Thomas Gleixner <tglx@linutronix.de> - 2017-06-05 10:30 +0200
Re: Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-05 14:00 +0200
Re: Design of interrupt controller driver Thomas Gleixner <tglx@linutronix.de> - 2017-06-06 09:40 +0200
Re: Design of interrupt controller driver Mason <slash.tmp@free.fr> - 2017-06-06 11:40 +0200
Re: Design of interrupt controller driver Thomas Gleixner <tglx@linutronix.de> - 2017-06-06 12:40 +0200
csiph-web