aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/DocBook
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-19 20:30:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-19 20:30:15 -0400
commitacd30250d7d0f495685d1c7c6184636a22fcdf7f (patch)
tree40f4e7e092de434c49a5f67f27ff1d3bf71000f9 /Documentation/DocBook
parent6595b4a940c4c447b619ab5268378ed03e632694 (diff)
parentedf76f8307c350bcb81f0c760118a991b3e62956 (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: irq: Export functions to allow modular irq drivers genirq: Uninline and sanity check generic_handle_irq() genirq: Remove pointless ifdefs genirq: Make generic irq chip depend on CONFIG_GENERIC_IRQ_CHIP genirq: Add chip suspend and resume callbacks genirq: Implement a generic interrupt chip genirq: Support per-IRQ thread disabling. genirq: irq_desc: Document preflow_handler and affinity_hint genirq: Update DocBook comments genirq: Forgotten updates/deletions after removal of compat code
Diffstat (limited to 'Documentation/DocBook')
-rw-r--r--Documentation/DocBook/genericirq.tmpl82
1 files changed, 47 insertions, 35 deletions
diff --git a/Documentation/DocBook/genericirq.tmpl b/Documentation/DocBook/genericirq.tmpl
index fb10fd08c05c..b3422341d65c 100644
--- a/Documentation/DocBook/genericirq.tmpl
+++ b/Documentation/DocBook/genericirq.tmpl
@@ -191,8 +191,8 @@
191 <para> 191 <para>
192 Whenever an interrupt triggers, the lowlevel arch code calls into 192 Whenever an interrupt triggers, the lowlevel arch code calls into
193 the generic interrupt code by calling desc->handle_irq(). 193 the generic interrupt code by calling desc->handle_irq().
194 This highlevel IRQ handling function only uses desc->chip primitives 194 This highlevel IRQ handling function only uses desc->irq_data.chip
195 referenced by the assigned chip descriptor structure. 195 primitives referenced by the assigned chip descriptor structure.
196 </para> 196 </para>
197 </sect1> 197 </sect1>
198 <sect1 id="Highlevel_Driver_API"> 198 <sect1 id="Highlevel_Driver_API">
@@ -206,11 +206,11 @@
206 <listitem><para>enable_irq()</para></listitem> 206 <listitem><para>enable_irq()</para></listitem>
207 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem> 207 <listitem><para>disable_irq_nosync() (SMP only)</para></listitem>
208 <listitem><para>synchronize_irq() (SMP only)</para></listitem> 208 <listitem><para>synchronize_irq() (SMP only)</para></listitem>
209 <listitem><para>set_irq_type()</para></listitem> 209 <listitem><para>irq_set_irq_type()</para></listitem>
210 <listitem><para>set_irq_wake()</para></listitem> 210 <listitem><para>irq_set_irq_wake()</para></listitem>
211 <listitem><para>set_irq_data()</para></listitem> 211 <listitem><para>irq_set_handler_data()</para></listitem>
212 <listitem><para>set_irq_chip()</para></listitem> 212 <listitem><para>irq_set_chip()</para></listitem>
213 <listitem><para>set_irq_chip_data()</para></listitem> 213 <listitem><para>irq_set_chip_data()</para></listitem>
214 </itemizedlist> 214 </itemizedlist>
215 See the autogenerated function documentation for details. 215 See the autogenerated function documentation for details.
216 </para> 216 </para>
@@ -225,6 +225,8 @@
225 <listitem><para>handle_fasteoi_irq</para></listitem> 225 <listitem><para>handle_fasteoi_irq</para></listitem>
226 <listitem><para>handle_simple_irq</para></listitem> 226 <listitem><para>handle_simple_irq</para></listitem>
227 <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>
228 </itemizedlist> 230 </itemizedlist>
229 The interrupt flow handlers (either predefined or architecture 231 The interrupt flow handlers (either predefined or architecture
230 specific) are assigned to specific interrupts by the architecture 232 specific) are assigned to specific interrupts by the architecture
@@ -241,13 +243,13 @@
241 <programlisting> 243 <programlisting>
242default_enable(struct irq_data *data) 244default_enable(struct irq_data *data)
243{ 245{
244 desc->chip->irq_unmask(data); 246 desc->irq_data.chip->irq_unmask(data);
245} 247}
246 248
247default_disable(struct irq_data *data) 249default_disable(struct irq_data *data)
248{ 250{
249 if (!delay_disable(data)) 251 if (!delay_disable(data))
250 desc->chip->irq_mask(data); 252 desc->irq_data.chip->irq_mask(data);
251} 253}
252 254
253default_ack(struct irq_data *data) 255default_ack(struct irq_data *data)
@@ -284,9 +286,9 @@ noop(struct irq_data *data))
284 <para> 286 <para>
285 The following control flow is implemented (simplified excerpt): 287 The following control flow is implemented (simplified excerpt):
286 <programlisting> 288 <programlisting>
287desc->chip->irq_mask(); 289desc->irq_data.chip->irq_mask_ack();
288handle_IRQ_event(desc->action); 290handle_irq_event(desc->action);
289desc->chip->irq_unmask(); 291desc->irq_data.chip->irq_unmask();
290 </programlisting> 292 </programlisting>
291 </para> 293 </para>
292 </sect3> 294 </sect3>
@@ -300,8 +302,8 @@ desc->chip->irq_unmask();
300 <para> 302 <para>
301 The following control flow is implemented (simplified excerpt): 303 The following control flow is implemented (simplified excerpt):
302 <programlisting> 304 <programlisting>
303handle_IRQ_event(desc->action); 305handle_irq_event(desc->action);
304desc->chip->irq_eoi(); 306desc->irq_data.chip->irq_eoi();
305 </programlisting> 307 </programlisting>
306 </para> 308 </para>
307 </sect3> 309 </sect3>
@@ -315,17 +317,17 @@ desc->chip->irq_eoi();
315 The following control flow is implemented (simplified excerpt): 317 The following control flow is implemented (simplified excerpt):
316 <programlisting> 318 <programlisting>
317if (desc->status &amp; running) { 319if (desc->status &amp; running) {
318 desc->chip->irq_mask(); 320 desc->irq_data.chip->irq_mask_ack();
319 desc->status |= pending | masked; 321 desc->status |= pending | masked;
320 return; 322 return;
321} 323}
322desc->chip->irq_ack(); 324desc->irq_data.chip->irq_ack();
323desc->status |= running; 325desc->status |= running;
324do { 326do {
325 if (desc->status &amp; masked) 327 if (desc->status &amp; masked)
326 desc->chip->irq_unmask(); 328 desc->irq_data.chip->irq_unmask();
327 desc->status &amp;= ~pending; 329 desc->status &amp;= ~pending;
328 handle_IRQ_event(desc->action); 330 handle_irq_event(desc->action);
329} while (status &amp; pending); 331} while (status &amp; pending);
330desc->status &amp;= ~running; 332desc->status &amp;= ~running;
331 </programlisting> 333 </programlisting>
@@ -344,7 +346,7 @@ desc->status &amp;= ~running;
344 <para> 346 <para>
345 The following control flow is implemented (simplified excerpt): 347 The following control flow is implemented (simplified excerpt):
346 <programlisting> 348 <programlisting>
347handle_IRQ_event(desc->action); 349handle_irq_event(desc->action);
348 </programlisting> 350 </programlisting>
349 </para> 351 </para>
350 </sect3> 352 </sect3>
@@ -362,12 +364,29 @@ handle_IRQ_event(desc->action);
362 <para> 364 <para>
363 The following control flow is implemented (simplified excerpt): 365 The following control flow is implemented (simplified excerpt):
364 <programlisting> 366 <programlisting>
365handle_IRQ_event(desc->action); 367if (desc->irq_data.chip->irq_ack)
366if (desc->chip->irq_eoi) 368 desc->irq_data.chip->irq_ack();
367 desc->chip->irq_eoi(); 369handle_irq_event(desc->action);
370if (desc->irq_data.chip->irq_eoi)
371 desc->irq_data.chip->irq_eoi();
368 </programlisting> 372 </programlisting>
369 </para> 373 </para>
370 </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>
371 </sect2> 390 </sect2>
372 <sect2 id="Quirks_and_optimizations"> 391 <sect2 id="Quirks_and_optimizations">
373 <title>Quirks and optimizations</title> 392 <title>Quirks and optimizations</title>
@@ -410,6 +429,7 @@ if (desc->chip->irq_eoi)
410 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem> 429 <listitem><para>irq_mask_ack() - Optional, recommended for performance</para></listitem>
411 <listitem><para>irq_mask()</para></listitem> 430 <listitem><para>irq_mask()</para></listitem>
412 <listitem><para>irq_unmask()</para></listitem> 431 <listitem><para>irq_unmask()</para></listitem>
432 <listitem><para>irq_eoi() - Optional, required for eoi flow handlers</para></listitem>
413 <listitem><para>irq_retrigger() - Optional</para></listitem> 433 <listitem><para>irq_retrigger() - Optional</para></listitem>
414 <listitem><para>irq_set_type() - Optional</para></listitem> 434 <listitem><para>irq_set_type() - Optional</para></listitem>
415 <listitem><para>irq_set_wake() - Optional</para></listitem> 435 <listitem><para>irq_set_wake() - Optional</para></listitem>
@@ -424,32 +444,24 @@ if (desc->chip->irq_eoi)
424 <chapter id="doirq"> 444 <chapter id="doirq">
425 <title>__do_IRQ entry point</title> 445 <title>__do_IRQ entry point</title>
426 <para> 446 <para>
427 The original implementation __do_IRQ() is an alternative entry 447 The original implementation __do_IRQ() was an alternative entry
428 point for all types of interrupts. 448 point for all types of interrupts. It not longer exists.
429 </para> 449 </para>
430 <para> 450 <para>
431 This handler turned out to be not suitable for all 451 This handler turned out to be not suitable for all
432 interrupt hardware and was therefore reimplemented with split 452 interrupt hardware and was therefore reimplemented with split
433 functionality for egde/level/simple/percpu interrupts. This is not 453 functionality for edge/level/simple/percpu interrupts. This is not
434 only a functional optimization. It also shortens code paths for 454 only a functional optimization. It also shortens code paths for
435 interrupts. 455 interrupts.
436 </para> 456 </para>
437 <para>
438 To make use of the split implementation, replace the call to
439 __do_IRQ by a call to desc->handle_irq() and associate
440 the appropriate handler function to desc->handle_irq().
441 In most cases the generic handler implementations should
442 be sufficient.
443 </para>
444 </chapter> 457 </chapter>
445 458
446 <chapter id="locking"> 459 <chapter id="locking">
447 <title>Locking on SMP</title> 460 <title>Locking on SMP</title>
448 <para> 461 <para>
449 The locking of chip registers is up to the architecture that 462 The locking of chip registers is up to the architecture that
450 defines the chip primitives. There is a chip->lock field that can be used 463 defines the chip primitives. The per-irq structure is
451 for serialization, but the generic layer does not touch it. The per-irq 464 protected via desc->lock, by the generic layer.
452 structure is protected via desc->lock, by the generic layer.
453 </para> 465 </para>
454 </chapter> 466 </chapter>
455 <chapter id="structs"> 467 <chapter id="structs">