1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Linux generic IRQ handling</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux generic IRQ handling"><link rel="next" href="intro.html" title="Chapter 1. Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Linux generic IRQ handling</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><div><h1 class="title"><a name="Generic-IRQ-Guide"></a>Linux generic IRQ handling</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Thomas</span> <span class="surname">Gleixner</span></h3><div class="affiliation"><div class="address"><p><br>
2      <code class="email">&lt;<a class="email" href="mailto:tglx@linutronix.de">tglx@linutronix.de</a>&gt;</code><br>
3     </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Ingo</span> <span class="surname">Molnar</span></h3><div class="affiliation"><div class="address"><p><br>
4      <code class="email">&lt;<a class="email" href="mailto:mingo@elte.hu">mingo@elte.hu</a>&gt;</code><br>
5     </p></div></div></div></div></div><div><p class="copyright">Copyright © 2005-2010 Thomas Gleixner</p></div><div><p class="copyright">Copyright © 2005-2006 Ingo Molnar</p></div><div><div class="legalnotice"><a name="id-1.1.5"></a><p>
6     This documentation is free software; you can redistribute
7     it and/or modify it under the terms of the GNU General Public
8     License version 2 as published by the Free Software Foundation.
9   </p><p>
10     This program is distributed in the hope that it will be
11     useful, but WITHOUT ANY WARRANTY; without even the implied
12     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13     See the GNU General Public License for more details.
14   </p><p>
15     You should have received a copy of the GNU General Public
16     License along with this program; if not, write to the Free
17     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18     MA 02111-1307 USA
19   </p><p>
20     For more details see the file COPYING in the source
21     distribution of Linux.
22   </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="chapter"><a href="intro.html">1. Introduction</a></span></dt><dt><span class="chapter"><a href="rationale.html">2. Rationale</a></span></dt><dt><span class="chapter"><a href="bugs.html">3. Known Bugs And Assumptions</a></span></dt><dt><span class="chapter"><a href="Abstraction.html">4. Abstraction layers</a></span></dt><dd><dl><dt><span class="sect1"><a href="Abstraction.html#Interrupt_control_flow">Interrupt control flow</a></span></dt><dt><span class="sect1"><a href="Highlevel_Driver_API.html">High-level Driver API</a></span></dt><dt><span class="sect1"><a href="Highlevel_IRQ_flow_handlers.html">High-level IRQ flow handlers</a></span></dt><dd><dl><dt><span class="sect2"><a href="Highlevel_IRQ_flow_handlers.html#Default_flow_implementations">Default flow implementations</a></span></dt><dt><span class="sect2"><a href="Highlevel_IRQ_flow_handlers.html#Default_flow_handler_implementations">Default flow handler implementations</a></span></dt><dt><span class="sect2"><a href="Highlevel_IRQ_flow_handlers.html#Quirks_and_optimizations">Quirks and optimizations</a></span></dt><dt><span class="sect2"><a href="Highlevel_IRQ_flow_handlers.html#Delayed_interrupt_disable">Delayed interrupt disable</a></span></dt></dl></dd><dt><span class="sect1"><a href="Chiplevel_hardware_encapsulation.html">Chip-level hardware encapsulation</a></span></dt></dl></dd><dt><span class="chapter"><a href="doirq.html">5. __do_IRQ entry point</a></span></dt><dt><span class="chapter"><a href="locking.html">6. Locking on SMP</a></span></dt><dt><span class="chapter"><a href="genericchip.html">7. Generic interrupt chip</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-irq-gc-mask-set-bit.html"><span class="phrase">irq_gc_mask_set_bit</span></a></span><span class="refpurpose"> — 
23  Mask chip via setting bit in mask register
24 </span></dt><dt><span class="refentrytitle"><a href="API-irq-gc-mask-clr-bit.html"><span class="phrase">irq_gc_mask_clr_bit</span></a></span><span class="refpurpose"> — 
25     Mask chip via clearing bit in mask register
26 </span></dt><dt><span class="refentrytitle"><a href="API-irq-gc-ack-set-bit.html"><span class="phrase">irq_gc_ack_set_bit</span></a></span><span class="refpurpose"> — 
27     Ack pending interrupt via setting bit
28 </span></dt><dt><span class="refentrytitle"><a href="API-irq-alloc-generic-chip.html"><span class="phrase">irq_alloc_generic_chip</span></a></span><span class="refpurpose"> — 
29     Allocate a generic chip and initialize it
30 </span></dt><dt><span class="refentrytitle"><a href="API-irq-alloc-domain-generic-chips.html"><span class="phrase">irq_alloc_domain_generic_chips</span></a></span><span class="refpurpose"> — 
31     Allocate generic chips for an irq domain
32 </span></dt><dt><span class="refentrytitle"><a href="API-irq-get-domain-generic-chip.html"><span class="phrase">irq_get_domain_generic_chip</span></a></span><span class="refpurpose"> — 
33     Get a pointer to the generic chip of a hw_irq
34 </span></dt><dt><span class="refentrytitle"><a href="API-irq-setup-generic-chip.html"><span class="phrase">irq_setup_generic_chip</span></a></span><span class="refpurpose"> — 
35     Setup a range of interrupts with a generic chip
36 </span></dt><dt><span class="refentrytitle"><a href="API-irq-setup-alt-chip.html"><span class="phrase">irq_setup_alt_chip</span></a></span><span class="refpurpose"> — 
37     Switch to alternative chip
38 </span></dt><dt><span class="refentrytitle"><a href="API-irq-remove-generic-chip.html"><span class="phrase">irq_remove_generic_chip</span></a></span><span class="refpurpose"> — 
39     Remove a chip
40 </span></dt></dl></dd><dt><span class="chapter"><a href="structs.html">8. Structures</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-struct-irq-common-data.html"><span class="phrase">struct irq_common_data</span></a></span><span class="refpurpose"> — 
41  per irq data shared by all irqchips
42 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-data.html"><span class="phrase">struct irq_data</span></a></span><span class="refpurpose"> — 
43     per irq chip data passed down to chip functions
44 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-chip.html"><span class="phrase">struct irq_chip</span></a></span><span class="refpurpose"> — 
45     hardware interrupt chip descriptor
46 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-chip-regs.html"><span class="phrase">struct irq_chip_regs</span></a></span><span class="refpurpose"> — 
47     register offsets for struct irq_gci
48 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-chip-type.html"><span class="phrase">struct irq_chip_type</span></a></span><span class="refpurpose"> — 
49     Generic interrupt chip instance for a flow type
50 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-chip-generic.html"><span class="phrase">struct irq_chip_generic</span></a></span><span class="refpurpose"> — 
51     Generic irq chip data structure
52 </span></dt><dt><span class="refentrytitle"><a href="API-enum-irq-gc-flags.html"><span class="phrase">enum irq_gc_flags</span></a></span><span class="refpurpose"> — 
53     Initialization flags for generic irq chips
54 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irqaction.html"><span class="phrase">struct irqaction</span></a></span><span class="refpurpose"> — 
55  per interrupt action descriptor
56 </span></dt><dt><span class="refentrytitle"><a href="API-struct-irq-affinity-notify.html"><span class="phrase">struct irq_affinity_notify</span></a></span><span class="refpurpose"> — 
57     context for notification of IRQ affinity changes
58 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-affinity.html"><span class="phrase">irq_set_affinity</span></a></span><span class="refpurpose"> — 
59     Set the irq affinity of a given irq
60 </span></dt><dt><span class="refentrytitle"><a href="API-irq-force-affinity.html"><span class="phrase">irq_force_affinity</span></a></span><span class="refpurpose"> — 
61     Force the irq affinity of a given irq
62 </span></dt></dl></dd><dt><span class="chapter"><a href="pubfunctions.html">9. Public Functions Provided</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-synchronize-hardirq.html"><span class="phrase">synchronize_hardirq</span></a></span><span class="refpurpose"> — 
63  wait for pending hard IRQ handlers (on other CPUs)
64 </span></dt><dt><span class="refentrytitle"><a href="API-synchronize-irq.html"><span class="phrase">synchronize_irq</span></a></span><span class="refpurpose"> — 
65     wait for pending IRQ handlers (on other CPUs)
66 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-affinity-notifier.html"><span class="phrase">irq_set_affinity_notifier</span></a></span><span class="refpurpose"> — 
67     control notification of IRQ affinity changes
68 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-vcpu-affinity.html"><span class="phrase">irq_set_vcpu_affinity</span></a></span><span class="refpurpose"> — 
69     Set vcpu affinity for the interrupt
70 </span></dt><dt><span class="refentrytitle"><a href="API-disable-irq-nosync.html"><span class="phrase">disable_irq_nosync</span></a></span><span class="refpurpose"> — 
71     disable an irq without waiting
72 </span></dt><dt><span class="refentrytitle"><a href="API-disable-irq.html"><span class="phrase">disable_irq</span></a></span><span class="refpurpose"> — 
73     disable an irq and wait for completion
74 </span></dt><dt><span class="refentrytitle"><a href="API-disable-hardirq.html"><span class="phrase">disable_hardirq</span></a></span><span class="refpurpose"> — 
75     disables an irq and waits for hardirq completion
76 </span></dt><dt><span class="refentrytitle"><a href="API-enable-irq.html"><span class="phrase">enable_irq</span></a></span><span class="refpurpose"> — 
77     enable handling of an irq
78 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-irq-wake.html"><span class="phrase">irq_set_irq_wake</span></a></span><span class="refpurpose"> — 
79     control irq power management wakeup
80 </span></dt><dt><span class="refentrytitle"><a href="API-irq-wake-thread.html"><span class="phrase">irq_wake_thread</span></a></span><span class="refpurpose"> — 
81     wake the irq thread for the action identified by dev_id
82 </span></dt><dt><span class="refentrytitle"><a href="API-setup-irq.html"><span class="phrase">setup_irq</span></a></span><span class="refpurpose"> — 
83     setup an interrupt
84 </span></dt><dt><span class="refentrytitle"><a href="API-remove-irq.html"><span class="phrase">remove_irq</span></a></span><span class="refpurpose"> — 
85     free an interrupt
86 </span></dt><dt><span class="refentrytitle"><a href="API-free-irq.html"><span class="phrase">free_irq</span></a></span><span class="refpurpose"> — 
87     free an interrupt allocated with request_irq
88 </span></dt><dt><span class="refentrytitle"><a href="API-request-threaded-irq.html"><span class="phrase">request_threaded_irq</span></a></span><span class="refpurpose"> — 
89     allocate an interrupt line
90 </span></dt><dt><span class="refentrytitle"><a href="API-request-any-context-irq.html"><span class="phrase">request_any_context_irq</span></a></span><span class="refpurpose"> — 
91     allocate an interrupt line
92 </span></dt><dt><span class="refentrytitle"><a href="API-free-percpu-irq.html"><span class="phrase">free_percpu_irq</span></a></span><span class="refpurpose"> — 
93     free an interrupt allocated with request_percpu_irq
94 </span></dt><dt><span class="refentrytitle"><a href="API-request-percpu-irq.html"><span class="phrase">request_percpu_irq</span></a></span><span class="refpurpose"> — 
95     allocate a percpu interrupt line
96 </span></dt><dt><span class="refentrytitle"><a href="API-irq-get-irqchip-state.html"><span class="phrase">irq_get_irqchip_state</span></a></span><span class="refpurpose"> — 
97     returns the irqchip state of a interrupt.
98 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-irqchip-state.html"><span class="phrase">irq_set_irqchip_state</span></a></span><span class="refpurpose"> — 
99     set the state of a forwarded interrupt.
100 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-chip.html"><span class="phrase">irq_set_chip</span></a></span><span class="refpurpose"> — 
101  set the irq chip for an irq
102 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-irq-type.html"><span class="phrase">irq_set_irq_type</span></a></span><span class="refpurpose"> — 
103     set the irq trigger type for an irq
104 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-handler-data.html"><span class="phrase">irq_set_handler_data</span></a></span><span class="refpurpose"> — 
105     set irq handler data for an irq
106 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-chip-data.html"><span class="phrase">irq_set_chip_data</span></a></span><span class="refpurpose"> — 
107     set irq chip data for an irq
108 </span></dt><dt><span class="refentrytitle"><a href="API-handle-simple-irq.html"><span class="phrase">handle_simple_irq</span></a></span><span class="refpurpose"> — 
109     Simple and software-decoded IRQs.
110 </span></dt><dt><span class="refentrytitle"><a href="API-handle-level-irq.html"><span class="phrase">handle_level_irq</span></a></span><span class="refpurpose"> — 
111     Level type irq handler
112 </span></dt><dt><span class="refentrytitle"><a href="API-handle-fasteoi-irq.html"><span class="phrase">handle_fasteoi_irq</span></a></span><span class="refpurpose"> — 
113     irq handler for transparent controllers
114 </span></dt><dt><span class="refentrytitle"><a href="API-handle-edge-irq.html"><span class="phrase">handle_edge_irq</span></a></span><span class="refpurpose"> — 
115     edge type IRQ handler
116 </span></dt></dl></dd><dt><span class="chapter"><a href="intfunctions.html">10. Internal Functions Provided</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API---handle-domain-irq.html"><span class="phrase">__handle_domain_irq</span></a></span><span class="refpurpose"> — 
117  Invoke the handler for a HW irq belonging to a domain
118 </span></dt><dt><span class="refentrytitle"><a href="API-irq-get-next-irq.html"><span class="phrase">irq_get_next_irq</span></a></span><span class="refpurpose"> — 
119     get next allocated irq number
120 </span></dt><dt><span class="refentrytitle"><a href="API-kstat-irqs-cpu.html"><span class="phrase">kstat_irqs_cpu</span></a></span><span class="refpurpose"> — 
121     Get the statistics for an interrupt on a cpu
122 </span></dt><dt><span class="refentrytitle"><a href="API-kstat-irqs.html"><span class="phrase">kstat_irqs</span></a></span><span class="refpurpose"> — 
123     Get the statistics for an interrupt
124 </span></dt><dt><span class="refentrytitle"><a href="API-kstat-irqs-usr.html"><span class="phrase">kstat_irqs_usr</span></a></span><span class="refpurpose"> — 
125     Get the statistics for an interrupt
126 </span></dt><dt><span class="refentrytitle"><a href="re53.html">
127   kernel/irq/handle.c
128  </a></span><span class="refpurpose"> — 
129   Document generation inconsistency
130  </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-msi-desc-off.html"><span class="phrase">irq_set_msi_desc_off</span></a></span><span class="refpurpose"> — 
131  set MSI descriptor data for an irq at offset
132 </span></dt><dt><span class="refentrytitle"><a href="API-irq-set-msi-desc.html"><span class="phrase">irq_set_msi_desc</span></a></span><span class="refpurpose"> — 
133     set MSI descriptor data for an irq
134 </span></dt><dt><span class="refentrytitle"><a href="API-irq-disable.html"><span class="phrase">irq_disable</span></a></span><span class="refpurpose"> — 
135     Mark interrupt disabled
136 </span></dt><dt><span class="refentrytitle"><a href="API-handle-edge-eoi-irq.html"><span class="phrase">handle_edge_eoi_irq</span></a></span><span class="refpurpose"> — 
137     edge eoi type IRQ handler
138 </span></dt><dt><span class="refentrytitle"><a href="API-handle-percpu-irq.html"><span class="phrase">handle_percpu_irq</span></a></span><span class="refpurpose"> — 
139     Per CPU local irq handler
140 </span></dt><dt><span class="refentrytitle"><a href="API-handle-percpu-devid-irq.html"><span class="phrase">handle_percpu_devid_irq</span></a></span><span class="refpurpose"> — 
141     Per CPU local irq handler with per cpu dev ids
142 </span></dt><dt><span class="refentrytitle"><a href="API-irq-cpu-online.html"><span class="phrase">irq_cpu_online</span></a></span><span class="refpurpose"> — 
143     Invoke all irq_cpu_online functions.
144 </span></dt><dt><span class="refentrytitle"><a href="API-irq-cpu-offline.html"><span class="phrase">irq_cpu_offline</span></a></span><span class="refpurpose"> — 
145     Invoke all irq_cpu_offline functions.
146 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-enable-parent.html"><span class="phrase">irq_chip_enable_parent</span></a></span><span class="refpurpose"> — 
147     Enable the parent interrupt (defaults to unmask if NULL)
148 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-disable-parent.html"><span class="phrase">irq_chip_disable_parent</span></a></span><span class="refpurpose"> — 
149     Disable the parent interrupt (defaults to mask if NULL)
150 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-ack-parent.html"><span class="phrase">irq_chip_ack_parent</span></a></span><span class="refpurpose"> — 
151     Acknowledge the parent interrupt
152 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-mask-parent.html"><span class="phrase">irq_chip_mask_parent</span></a></span><span class="refpurpose"> — 
153     Mask the parent interrupt
154 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-unmask-parent.html"><span class="phrase">irq_chip_unmask_parent</span></a></span><span class="refpurpose"> — 
155     Unmask the parent interrupt
156 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-eoi-parent.html"><span class="phrase">irq_chip_eoi_parent</span></a></span><span class="refpurpose"> — 
157     Invoke EOI on the parent interrupt
158 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-set-affinity-parent.html"><span class="phrase">irq_chip_set_affinity_parent</span></a></span><span class="refpurpose"> — 
159     Set affinity on the parent interrupt
160 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-set-type-parent.html"><span class="phrase">irq_chip_set_type_parent</span></a></span><span class="refpurpose"> — 
161     Set IRQ type on the parent interrupt
162 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-retrigger-hierarchy.html"><span class="phrase">irq_chip_retrigger_hierarchy</span></a></span><span class="refpurpose"> — 
163     Retrigger an interrupt in hardware
164 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-set-vcpu-affinity-parent.html"><span class="phrase">irq_chip_set_vcpu_affinity_parent</span></a></span><span class="refpurpose"> — 
165     Set vcpu affinity on the parent interrupt
166 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-set-wake-parent.html"><span class="phrase">irq_chip_set_wake_parent</span></a></span><span class="refpurpose"> — 
167     Set/reset wake-up on the parent interrupt
168 </span></dt><dt><span class="refentrytitle"><a href="API-irq-chip-compose-msi-msg.html"><span class="phrase">irq_chip_compose_msi_msg</span></a></span><span class="refpurpose"> — 
169     Componse msi message for a irq chip
170 </span></dt></dl></dd><dt><span class="chapter"><a href="credits.html">11. Credits</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Introduction</td></tr></table></div></body></html>
171