• Home
  • Raw
  • Download

Lines Matching +full:chip +full:- +full:to +full:- +full:chip

7 :Copyright: |copy| 2005-2010: Thomas Gleixner
8 :Copyright: |copy| 2005-2006: Ingo Molnar
13 The generic interrupt handling layer is designed to provide a complete
14 abstraction of interrupt handling for device drivers. It is able to
16 drivers use generic API functions to request, enable, disable and free
17 interrupts. The drivers do not have to know anything about interrupt
21 This documentation is provided to developers who want to implement an
29 __do_IRQ() super-handler, which is able to deal with every type of
32 Originally, Russell King identified different types of handlers to build
36 - Level type
38 - Edge type
40 - Simple type
44 - Fast EOI type
46 In the SMP world of the __do_IRQ() super-handler another type was
49 - Per CPU type
51 This split implementation of high-level IRQ handlers allows us to
57 structures and their ``->ack``, ``->end`` [etc.] callbacks to differentiate
58 the flow control in the super-handler. This leads to a mix of flow logic
59 and low-level hardware logic, and it also leads to unnecessary code
61 ``ioapic_edge_irq`` IRQ-type which share many of the low-level details but
65 the 'chip details'.
69 and only need to add the chip-level specific code. The separation is
71 IRQ flow itself but not in the chip details - and thus provides a more
74 Each interrupt descriptor is assigned its own high-level flow handler,
75 which is normally one of the generic implementations. (This high-level
76 flow handler implementation also makes it simple to provide
82 IRQ-flow implementation for 'level type' interrupts and add a
85 To make the transition to the new model easier and prevent the breakage
86 of existing implementations, the __do_IRQ() super-handler is still
87 available. This leads to a kind of duality for the time being. Over time
90 years now and about to be removed.
102 1. High-level driver API
104 2. High-level IRQ flow handlers
106 3. Chip-level hardware encapsulation
109 ----------------------
115 status information and pointers to the interrupt flow method and the
116 interrupt chip structure which are assigned to this interrupt.
118 Whenever an interrupt triggers, the low-level architecture code calls
119 into the generic interrupt code by calling desc->handle_irq(). This
120 high-level IRQ handling function only uses desc->irq_data.chip
121 primitives referenced by the assigned chip descriptor structure.
123 High-level Driver API
124 ---------------------
126 The high-level Driver API consists of following functions:
128 - request_irq()
130 - request_threaded_irq()
132 - free_irq()
134 - disable_irq()
136 - enable_irq()
138 - disable_irq_nosync() (SMP only)
140 - synchronize_irq() (SMP only)
142 - irq_set_irq_type()
144 - irq_set_irq_wake()
146 - irq_set_handler_data()
148 - irq_set_chip()
150 - irq_set_chip_data()
154 High-level IRQ flow handlers
155 ----------------------------
157 The generic layer provides a set of pre-defined irq-flow methods:
159 - handle_level_irq()
161 - handle_edge_irq()
163 - handle_fasteoi_irq()
165 - handle_simple_irq()
167 - handle_percpu_irq()
169 - handle_edge_eoi_irq()
171 - handle_bad_irq()
173 The interrupt flow handlers (either pre-defined or architecture
174 specific) are assigned to specific interrupts by the architecture either
183 The helper functions call the chip primitives and are used by the
189 desc->irq_data.chip->irq_unmask(data);
195 desc->irq_data.chip->irq_mask(data);
200 chip->irq_ack(data);
205 if (chip->irq_mask_ack) {
206 chip->irq_mask_ack(data);
208 chip->irq_mask(data);
209 chip->irq_ack(data);
225 handle_level_irq provides a generic implementation for level-triggered
230 desc->irq_data.chip->irq_mask_ack();
231 handle_irq_event(desc->action);
232 desc->irq_data.chip->irq_unmask();
243 handle_irq_event(desc->action);
244 desc->irq_data.chip->irq_eoi();
250 handle_edge_irq provides a generic implementation for edge-triggered
255 if (desc->status & running) {
256 desc->irq_data.chip->irq_mask_ack();
257 desc->status |= pending | masked;
260 desc->irq_data.chip->irq_ack();
261 desc->status |= running;
263 if (desc->status & masked)
264 desc->irq_data.chip->irq_unmask();
265 desc->status &= ~pending;
266 handle_irq_event(desc->action);
267 } while (desc->status & pending);
268 desc->status &= ~running;
279 The simple flow handler does not call any handler/chip primitives.
283 handle_irq_event(desc->action);
297 if (desc->irq_data.chip->irq_ack)
298 desc->irq_data.chip->irq_ack();
299 handle_irq_event(desc->action);
300 if (desc->irq_data.chip->irq_eoi)
301 desc->irq_data.chip->irq_eoi();
308 which is solely used to tame a badly wreckaged irq controller on
321 which have no platform-specific IRQ handling quirks. If an architecture
322 needs to implement quirks on the 'flow' level then it can do so by
323 overriding the high-level irq-flow handler.
336 IRQ_PENDING bit is set. When the interrupt is re-enabled by
339 necessary to enable CONFIG_HARDIRQS_SW_RESEND when you want to use
344 Chip-level hardware encapsulation
345 ---------------------------------
347 The chip-level hardware descriptor structure :c:type:`irq_chip` contains all
348 the direct chip relevant functions, which can be utilized by the irq flow
351 - ``irq_ack``
353 - ``irq_mask_ack`` - Optional, recommended for performance
355 - ``irq_mask``
357 - ``irq_unmask``
359 - ``irq_eoi`` - Optional, required for EOI flow handlers
361 - ``irq_retrigger`` - Optional
363 - ``irq_set_type`` - Optional
365 - ``irq_set_wake`` - Optional
367 These primitives are strictly intended to mean what they say: ack means
368 ACK, masking means masking of an IRQ line, etc. It is up to the flow
369 handler(s) to use these basic units of low-level functionality.
377 This handler turned out to be not suitable for all interrupt hardware
385 The locking of chip registers is up to the architecture that defines the
386 chip primitives. The per-irq structure is protected via desc->lock, by
389 Generic interrupt chip
392 To avoid copies of identical implementations of IRQ chips the core
393 provides a configurable generic interrupt chip implementation.
394 Developers should check carefully whether the generic chip fits their
398 .. kernel-doc:: kernel/irq/generic-chip.c
407 .. kernel-doc:: include/linux/irq.h
410 .. kernel-doc:: include/linux/interrupt.h
413 .. kernel-doc:: include/linux/irqdomain.h
421 .. kernel-doc:: kernel/irq/manage.c
423 .. kernel-doc:: kernel/irq/chip.c
432 .. kernel-doc:: kernel/irq/irqdesc.c
434 .. kernel-doc:: kernel/irq/handle.c
436 .. kernel-doc:: kernel/irq/chip.c
442 The following people have contributed to this document: