aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook/genericirq.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/DocBook/genericirq.tmpl')
-rw-r--r--Documentation/DocBook/genericirq.tmpl144
1 files changed, 88 insertions, 56 deletions
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl
index 1448b33fd222..b3422341d65c 100644
--- a/Documentation/DocBook/genericirq.tmpl
+++ b/Documentation/DocBook/genericirq.tmpl
@@ -28,7 +28,7 @@
28 </authorgroup> 28 </authorgroup>
29 29
30 <copyright> 30 <copyright>
31 <year>2005-2006</year> 31 <year>2005-2010</year>
32 <holder>Thomas Gleixner</holder> 32 <holder>Thomas Gleixner</holder>
33 </copyright> 33 </copyright>
34 <copyright> 34 <copyright>
@@ -100,6 +100,10 @@
100 <listitem><para>Edge type</para></listitem> 100 <listitem><para>Edge type</para></listitem>
101 <listitem><para>Simple type</para></listitem> 101 <listitem><para>Simple type</para></listitem>
102 </itemizedlist> 102 </itemizedlist>
103 During the implementation we identified another type:
104 <itemizedlist>
105 <listitem><para>Fast EOI type</para></listitem>
106 </itemizedlist>
103 In the SMP world of the __do_IRQ() super-handler another type 107 In the SMP world of the __do_IRQ() super-handler another type
104 was identified: 108 was identified:
105 <itemizedlist> 109 <itemizedlist>
@@ -153,6 +157,7 @@
153 is still available. This leads to a kind of duality for the time 157 is still available. This leads to a kind of duality for the time
154 being. Over time the new model should be used in more and more 158 being. Over time the new model should be used in more and more
155 architectures, as it enables smaller and cleaner IRQ subsystems. 159 architectures, as it enables smaller and cleaner IRQ subsystems.
160 It's deprecated for three years now and about to be removed.
156 </para> 161 </para>
157 </chapter> 162 </chapter>
158 <chapter id="bugs"> 163 <chapter id="bugs">
@@ -186,8 +191,8 @@
186 <para> 191 <para>
187 Whenever an interrupt triggers, the lowlevel arch code calls into 192 Whenever an interrupt triggers, the lowlevel arch code calls into
188 the generic interrupt code by calling desc->handle_irq(). 193 the generic interrupt code by calling desc->handle_irq().
189 This highlevel IRQ handling function only uses desc->chip primitives 194 This highlevel IRQ handling function only uses desc->irq_data.chip
190 referenced by the assigned chip descriptor structure. 195 primitives referenced by the assigned chip descriptor structure.
191 </para> 196 </para>
192 </sect1> 197 </sect1>
193 <sect1 id="Highlevel_Driver_API"> 198 <sect1 id="Highlevel_Driver_API">
@@ -201,11 +206,11 @@
201 <listitem><para>enable_irq()</para></listitem> 206 <listitem><para>enable_irq()</para></listitem>
202 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem> 207 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem>
203 <listitem><para>synchronize_irq() (SMP only)</para></listitem> 208 <listitem><para>synchronize_irq() (SMP only)</para></listitem>
204 <listitem><para>set_irq_type()</para></listitem> 209 <listitem><para>irq_set_irq_type()</para></listitem>
205 <listitem><para>set_irq_wake()</para></listitem> 210 <listitem><para>irq_set_irq_wake()</para></listitem>
206 <listitem><para>set_irq_data()</para></listitem> 211 <listitem><para>irq_set_handler_data()</para></listitem>
207 <listitem><para>set_irq_chip()</para></listitem> 212 <listitem><para>irq_set_chip()</para></listitem>
208 <listitem><para>set_irq_chip_data()</para></listitem> 213 <listitem><para>irq_set_chip_data()</para></listitem>
209 </itemizedlist> 214 </itemizedlist>
210 See the autogenerated function documentation for details. 215 See the autogenerated function documentation for details.
211 </para> 216 </para>
@@ -217,8 +222,11 @@
217 <itemizedlist> 222 <itemizedlist>
218 <listitem><para>handle_level_irq</para></listitem> 223 <listitem><para>handle_level_irq</para></listitem>
219 <listitem><para>handle_edge_irq</para></listitem> 224 <listitem><para>handle_edge_irq</para></listitem>
225 <listitem><para>handle_fasteoi_irq</para></listitem>
220 <listitem><para>handle_simple_irq</para></listitem> 226 <listitem><para>handle_simple_irq</para></listitem>
221 <listitem><para>handle_percpu_irq</para></listitem> 227 <listitem><para>handle_percpu_irq</para></listitem>
228 <listitem><para>handle_edge_eoi_irq</para></listitem>
229 <listitem><para>handle_bad_irq</para></listitem>
222 </itemizedlist> 230 </itemizedlist>
223 The interrupt flow handlers (either predefined or architecture 231 The interrupt flow handlers (either predefined or architecture
224 specific) are assigned to specific interrupts by the architecture 232 specific) are assigned to specific interrupts by the architecture
@@ -233,33 +241,33 @@
233 are used by the default flow implementations. 241 are used by the default flow implementations.
234 The following helper functions are implemented (simplified excerpt): 242 The following helper functions are implemented (simplified excerpt):
235 <programlisting> 243 <programlisting>
236default_enable(irq) 244default_enable(struct irq_data *data)
237{ 245{
238 desc->chip->unmask(irq); 246 desc->irq_data.chip->irq_unmask(data);
239} 247}
240 248
241default_disable(irq) 249default_disable(struct irq_data *data)
242{ 250{
243 if (!delay_disable(irq)) 251 if (!delay_disable(data))
244 desc->chip->mask(irq); 252 desc->irq_data.chip->irq_mask(data);
245} 253}
246 254
247default_ack(irq) 255default_ack(struct irq_data *data)
248{ 256{
249 chip->ack(irq); 257 chip->irq_ack(data);
250} 258}
251 259
252default_mask_ack(irq) 260default_mask_ack(struct irq_data *data)
253{ 261{
254 if (chip->mask_ack) { 262 if (chip->irq_mask_ack) {
255 chip->mask_ack(irq); 263 chip->irq_mask_ack(data);
256 } else { 264 } else {
257 chip->mask(irq); 265 chip->irq_mask(data);
258 chip->ack(irq); 266 chip->irq_ack(data);
259 } 267 }
260} 268}
261 269
262noop(irq) 270noop(struct irq_data *data))
263{ 271{
264} 272}
265 273
@@ -278,12 +286,27 @@ noop(irq)
278 <para> 286 <para>
279 The following control flow is implemented (simplified excerpt): 287 The following control flow is implemented (simplified excerpt):
280 <programlisting> 288 <programlisting>
281desc->chip->start(); 289desc->irq_data.chip->irq_mask_ack();
282handle_IRQ_event(desc->action); 290handle_irq_event(desc->action);
283desc->chip->end(); 291desc->irq_data.chip->irq_unmask();
284 </programlisting> 292 </programlisting>
285 </para> 293 </para>
286 </sect3> 294 </sect3>
295 <sect3 id="Default_FASTEOI_IRQ_flow_handler">
296 <title>Default Fast EOI IRQ flow handler</title>
297 <para>
298 handle_fasteoi_irq provides a generic implementation
299 for interrupts, which only need an EOI at the end of
300 the handler
301 </para>
302 <para>
303 The following control flow is implemented (simplified excerpt):
304 <programlisting>
305handle_irq_event(desc->action);
306desc->irq_data.chip->irq_eoi();
307 </programlisting>
308 </para>
309 </sect3>
287 <sect3 id="Default_Edge_IRQ_flow_handler"> 310 <sect3 id="Default_Edge_IRQ_flow_handler">
288 <title>Default Edge IRQ flow handler</title> 311 <title>Default Edge IRQ flow handler</title>
289 <para> 312 <para>
@@ -294,20 +317,19 @@ desc->chip->end();
294 The following control flow is implemented (simplified excerpt): 317 The following control flow is implemented (simplified excerpt):
295 <programlisting> 318 <programlisting>
296if (desc->status &amp; running) { 319if (desc->status &amp; running) {
297 desc->chip->hold(); 320 desc->irq_data.chip->irq_mask_ack();
298 desc->status |= pending | masked; 321 desc->status |= pending | masked;
299 return; 322 return;
300} 323}
301desc->chip->start(); 324desc->irq_data.chip->irq_ack();
302desc->status |= running; 325desc->status |= running;
303do { 326do {
304 if (desc->status &amp; masked) 327 if (desc->status &amp; masked)
305 desc->chip->enable(); 328 desc->irq_data.chip->irq_unmask();
306 desc->status &amp;= ~pending; 329 desc->status &amp;= ~pending;
307 handle_IRQ_event(desc->action); 330 handle_irq_event(desc->action);
308} while (status &amp; pending); 331} while (status &amp; pending);
309desc->status &amp;= ~running; 332desc->status &amp;= ~running;
310desc->chip->end();
311 </programlisting> 333 </programlisting>
312 </para> 334 </para>
313 </sect3> 335 </sect3>
@@ -324,7 +346,7 @@ desc->chip->end();
324 <para> 346 <para>
325 The following control flow is implemented (simplified excerpt): 347 The following control flow is implemented (simplified excerpt):
326 <programlisting> 348 <programlisting>
327handle_IRQ_event(desc->action); 349handle_irq_event(desc->action);
328 </programlisting> 350 </programlisting>
329 </para> 351 </para>
330 </sect3> 352 </sect3>
@@ -342,12 +364,29 @@ handle_IRQ_event(desc->action);
342 <para> 364 <para>
343 The following control flow is implemented (simplified excerpt): 365 The following control flow is implemented (simplified excerpt):
344 <programlisting> 366 <programlisting>
345desc->chip->start(); 367if (desc->irq_data.chip->irq_ack)
346handle_IRQ_event(desc->action); 368 desc->irq_data.chip->irq_ack();
347desc->chip->end(); 369handle_irq_event(desc->action);
370if (desc->irq_data.chip->irq_eoi)
371 desc->irq_data.chip->irq_eoi();
348 </programlisting> 372 </programlisting>
349 </para> 373 </para>
350 </sect3> 374 </sect3>
375 <sect3 id="EOI_Edge_IRQ_flow_handler">
376 <title>EOI Edge IRQ flow handler</title>
377 <para>
378 handle_edge_eoi_irq provides an abnomination of the edge
379 handler which is solely used to tame a badly wreckaged
380 irq controller on powerpc/cell.
381 </para>
382 </sect3>
383 <sect3 id="BAD_IRQ_flow_handler">
384 <title>Bad IRQ flow handler</title>
385 <para>
386 handle_bad_irq is used for spurious interrupts which
387 have no real handler assigned..
388 </para>
389 </sect3>
351 </sect2> 390 </sect2>
352 <sect2 id="Quirks_and_optimizations"> 391 <sect2 id="Quirks_and_optimizations">
353 <title>Quirks and optimizations</title> 392 <title>Quirks and optimizations</title>
@@ -375,8 +414,7 @@ desc->chip->end();
375 mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when 414 mechanism. (It's necessary to enable CONFIG_HARDIRQS_SW_RESEND when
376 you want to use the delayed interrupt disable feature and your 415 you want to use the delayed interrupt disable feature and your
377 hardware is not capable of retriggering an interrupt.) 416 hardware is not capable of retriggering an interrupt.)
378 The delayed interrupt disable can be runtime enabled, per interrupt, 417 The delayed interrupt disable is not configurable.
379 by setting the IRQ_DELAYED_DISABLE flag in the irq_desc status field.
380 </para> 418 </para>
381 </sect2> 419 </sect2>
382 </sect1> 420 </sect1>
@@ -387,13 +425,14 @@ desc->chip->end();
387 contains all the direct chip relevant functions, which 425 contains all the direct chip relevant functions, which
388 can be utilized by the irq flow implementations. 426 can be utilized by the irq flow implementations.
389 <itemizedlist> 427 <itemizedlist>
390 <listitem><para>ack()</para></listitem> 428 <listitem><para>irq_ack()</para></listitem>
391 <listitem><para>mask_ack() - Optional, recommended for performance</para></listitem> 429 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem>
392 <listitem><para>mask()</para></listitem> 430 <listitem><para>irq_mask()</para></listitem>
393 <listitem><para>unmask()</para></listitem> 431 <listitem><para>irq_unmask()</para></listitem>
394 <listitem><para>retrigger() - Optional</para></listitem> 432 <listitem><para>irq_eoi() - Optional, required for eoi flow handlers</para></listitem>
395 <listitem><para>set_type() - Optional</para></listitem> 433 <listitem><para>irq_retrigger() - Optional</para></listitem>
396 <listitem><para>set_wake() - Optional</para></listitem> 434 <listitem><para>irq_set_type() - Optional</para></listitem>
435 <listitem><para>irq_set_wake() - Optional</para></listitem>
397 </itemizedlist> 436 </itemizedlist>
398 These primitives are strictly intended to mean what they say: ack means 437 These primitives are strictly intended to mean what they say: ack means
399 ACK, masking means masking of an IRQ line, etc. It is up to the flow 438 ACK, masking means masking of an IRQ line, etc. It is up to the flow
@@ -405,32 +444,24 @@ desc->chip->end();
405 <chapter id="doirq"> 444 <chapter id="doirq">
406 <title>__do_IRQ entry point</title> 445 <title>__do_IRQ entry point</title>
407 <para> 446 <para>
408 The original implementation __do_IRQ() is an alternative entry 447 The original implementation __do_IRQ() was an alternative entry
409 point for all types of interrupts. 448 point for all types of interrupts. It not longer exists.
410 </para> 449 </para>
411 <para> 450 <para>
412 This handler turned out to be not suitable for all 451 This handler turned out to be not suitable for all
413 interrupt hardware and was therefore reimplemented with split 452 interrupt hardware and was therefore reimplemented with split
414 functionality for egde/level/simple/percpu interrupts. This is not 453 functionality for edge/level/simple/percpu interrupts. This is not
415 only a functional optimization. It also shortens code paths for 454 only a functional optimization. It also shortens code paths for
416 interrupts. 455 interrupts.
417 </para> 456 </para>
418 <para>
419 To make use of the split implementation, replace the call to
420 __do_IRQ by a call to desc->handle_irq() and associate
421 the appropriate handler function to desc->handle_irq().
422 In most cases the generic handler implementations should
423 be sufficient.
424 </para>
425 </chapter> 457 </chapter>
426 458
427 <chapter id="locking"> 459 <chapter id="locking">
428 <title>Locking on SMP</title> 460 <title>Locking on SMP</title>
429 <para> 461 <para>
430 The locking of chip registers is up to the architecture that 462 The locking of chip registers is up to the architecture that
431 defines the chip primitives. There is a chip->lock field that can be used 463 defines the chip primitives. The per-irq structure is
432 for serialization, but the generic layer does not touch it. The per-irq 464 protected via desc->lock, by the generic layer.
433 structure is protected via desc->lock, by the generic layer.
434 </para> 465 </para>
435 </chapter> 466 </chapter>
436 <chapter id="structs"> 467 <chapter id="structs">
@@ -458,6 +489,7 @@ desc->chip->end();
458 <para> 489 <para>
459 This chapter contains the autogenerated documentation of the internal functions. 490 This chapter contains the autogenerated documentation of the internal functions.
460 </para> 491 </para>
492!Ikernel/irq/irqdesc.c
461!Ikernel/irq/handle.c 493!Ikernel/irq/handle.c
462!Ikernel/irq/chip.c 494!Ikernel/irq/chip.c
463 </chapter> 495 </chapter>