요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. include:: <isonum.txt>
==========================
Linux generic IRQ handling
==========================
:Copyright: |copy| 2005-2010: Thomas Gleixner
:Copyright: |copy| 2005-2006: Ingo Molnar
Introduction
============
The generic interrupt handling layer is designed to provide a complete
abstraction of interrupt handling for device drivers. It is able to
handle all the different types of interrupt controller hardware. Device
drivers use generic API functions to request, enable, disable and free
interrupts. The drivers do not have to know anything about interrupt
hardware details, so they can be used on different platforms without
code changes.
This documentation is provided to developers who want to implement an
interrupt subsystem based for their architecture, with the help of the
generic IRQ handling layer.
Rationale
=========
The original implementation of interrupt handling in Linux uses the
__do_IRQ() super-handler, which is able to deal with every type of
interrupt logic.
Originally, Russell King identified different types of handlers to build
a quite universal set for the ARM interrupt handler implementation in
Linux 2.5/2.6. He distinguished between:
- Level type
- Edge type
- Simple type
During the implementation we identified another type:
- Fast EOI type
In the SMP world of the __do_IRQ() super-handler another type was
identified:
- Per CPU type
This split implementation of high-level IRQ handlers allows us to
optimize the flow of the interrupt handling for each specific interrupt
type. This reduces complexity in that particular code path and allows
the optimized handling of a given type.
The original general IRQ implementation used hw_interrupt_type
structures and their ``->ack``, ``->end`` [etc.] callbacks to differentiate
the flow control in the super-handler. This leads to a mix of flow logic
and low-level hardware logic, and it also leads to unnecessary code
duplication: for example in i386, there is an ``ioapic_level_irq`` and an
``ioapic_edge_irq`` IRQ-type which share many of the low-level details but
have different flow handling.
A more natural abstraction is the clean separation of the 'irq flow' and
the 'chip details'.
Analysing a couple of architecture's IRQ subsystem implementations
reveals that most of them can use a generic set of 'irq flow' methods
and only need to add the chip-level specific code. The separation is
also valuable for (sub)architectures which need specific quirks in the
IRQ flow itself but not in the chip details - and thus provides a more
transparent IRQ subsystem design.
Each interrupt descriptor is assigned its own high-level flow handler,
which is normally one of the generic implementations. (This high-level
flow handler implementation also makes it simple to provide
demultiplexing handlers which can be found in embedded platforms on
various architectures.)
The separation makes the generic interrupt handling layer more flexible
and extensible. For example, an (sub)architecture can use a generic
IRQ-flow implementation for 'level type' interrupts and add a
(sub)architecture specific 'edge type' implementation.
To make the transition to the new model easier and prevent the breakage
of existing implementations, the __do_IRQ() super-handler is still
available. This leads to a kind of duality for the time being. Over time
the new model should be used in more and more architectures, as it
enables smaller and cleaner IRQ subsystems. It's deprecated for three
years now and about to be removed.
Known Bugs And Assumptions
==========================
None (knock on wood).
Abstraction layers
==================
There are three main levels of abstraction in the interrupt code:
1. High-level driver API
2. High-level IRQ flow handlers
3. Chip-level hardware encapsulation
Interrupt control flow
----------------------
Each interrupt is described by an interrupt descriptor structure
irq_desc. The interrupt is referenced by an 'unsigned int' numeric
value which selects the corresponding interrupt description structure in
the descriptor structures array. The descriptor structure contains
status information and pointers to the interrupt flow method and the
interrupt chip structure which are assigned to this interrupt.
Whenever an interrupt triggers, the low-level architecture code calls
into the generic interrupt code by calling desc->handle_irq(). This
high-level IRQ handling function only uses desc->irq_data.chip
primitives referenced by the assigned chip descriptor structure.
High-level Driver API
---------------------
The high-level Driver API consists of following functions:
- request_irq()
- request_threaded_irq()
- free_irq()
- disable_irq()
- enable_irq()
- disable_irq_nosync() (SMP only)
- synchronize_irq() (SMP only)
- irq_set_irq_type()
- irq_set_irq_wake()
- irq_set_handler_data()
- irq_set_chip()
- irq_set_chip_data()
See the autogenerated function documentation for details.
High-level IRQ flow handlers
----------------------------
The generic layer provides a set of pre-defined irq-flow methods:
- handle_level_irq()
- handle_edge_irq()
- handle_fasteoi_irq()
- handle_simple_irq()
- handle_percpu_irq()
- handle_edge_eoi_irq()
- handle_bad_irq()
The interrupt flow handlers (either pre-defined or architecture
specific) are assigned to specific interrupts by the architecture either
during bootup or during device initialization.
Default flow implementations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Helper functions
^^^^^^^^^^^^^^^^
The helper functions call the chip primitives and are used by the
default flow implementations. The following helper functions are
implemented (simplified excerpt)::
default_enable(struct irq_data *data)
{
desc->irq_data.chip->irq_unmask(data);
}
default_disable(struct irq_data *data)
{
if (!delay_disable(data))
desc->irq_data.chip->irq_mask(data);
}
default_ack(struct irq_data *data)
{
chip->irq_ack(data);
}
default_mask_ack(struct irq_data *data)
{
if (chip->irq_mask_ack) {
chip->irq_mask_ack(data);
} else {
chip->irq_mask(data);
chip->irq_ack(data);
}
}
noop(struct irq_data *data)
{
}
Default flow handler implementations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Default Level IRQ flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_level_irq provides a generic implementation for level-triggered
interrupts.
The following control flow is implemented (simplified excerpt)::
desc->irq_data.chip->irq_mask_ack();
handle_irq_event(desc->action);
desc->irq_data.chip->irq_unmask();
Default Fast EOI IRQ flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_fasteoi_irq provides a generic implementation for interrupts,
which only need an EOI at the end of the handler.
The following control flow is implemented (simplified excerpt)::
handle_irq_event(desc->action);
desc->irq_data.chip->irq_eoi();
Default Edge IRQ flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_edge_irq provides a generic implementation for edge-triggered
interrupts.
The following control flow is implemented (simplified excerpt)::
if (desc->status & running) {
desc->irq_data.chip->irq_mask_ack();
desc->status |= pending | masked;
return;
}
desc->irq_data.chip->irq_ack();
desc->status |= running;
do {
if (desc->status & masked)
desc->irq_data.chip->irq_unmask();
desc->status &= ~pending;
handle_irq_event(desc->action);
} while (desc->status & pending);
desc->status &= ~running;
Default simple IRQ flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_simple_irq provides a generic implementation for simple
interrupts.
.. note::
The simple flow handler does not call any handler/chip primitives.
The following control flow is implemented (simplified excerpt)::
handle_irq_event(desc->action);
Default per CPU flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
handle_percpu_irq provides a generic implementation for per CPU
interrupts.
Per CPU interrupts are only available on SMP and the handler provides a
simplified version without locking.
The following control flow is implemented (simplified excerpt)::
if (desc->irq_data.chip->irq_ack)
desc->irq_data.chip->irq_ack();
handle_irq_event(desc->action);
if (desc->irq_data.chip->irq_eoi)
desc->irq_data.chip->irq_eoi();
EOI Edge IRQ flow handler
^^^^^^^^^^^^^^^^^^^^^^^^^
handle_edge_eoi_irq provides an abnomination of the edge handler
which is solely used to tame a badly wreckaged irq controller on
powerpc/cell.
Bad IRQ flow handler
^^^^^^^^^^^^^^^^^^^^
handle_bad_irq is used for spurious interrupts which have no real
handler assigned..
Quirks and optimizations
~~~~~~~~~~~~~~~~~~~~~~~~
The generic functions are intended for 'clean' architectures and chips,
which have no platform-specific IRQ handling quirks. If an architecture
needs to implement quirks on the 'flow' level then it can do so by
overriding the high-level irq-flow handler.
Delayed interrupt disable
~~~~~~~~~~~~~~~~~~~~~~~~~
This per interrupt selectable feature, which was introduced by Russell
King in the ARM interrupt implementation, does not mask an interrupt at
the hardware level when disable_irq() is called. The interrupt is kept
enabled and is masked in the flow handler when an interrupt event
happens. This prevents losing edge interrupts on hardware which does not
store an edge interrupt event while the interrupt is disabled at the
hardware level. When an interrupt arrives while the IRQ_DISABLED flag
is set, then the interrupt is masked at the hardware level and the
IRQ_PENDING bit is set. When the interrupt is re-enabled by
enable_irq() the pending bit is checked and if it is set, the interrupt
is resent either via hardware or by a software resend mechanism. (It's
necessary to enable CONFIG_HARDIRQS_SW_RESEND when you want to use
the delayed interrupt disable feature and your hardware is not capable
of retriggering an interrupt.) The delayed interrupt disable is not
configurable.
Chip-level hardware encapsulation
---------------------------------
The chip-level hardware descriptor structure :c:type:`irq_chip` contains all
the direct chip relevant functions, which can be utilized by the irq flow
implementations.
- ``irq_ack``
- ``irq_mask_ack`` - Optional, recommended for performance
- ``irq_mask``
- ``irq_unmask``
- ``irq_eoi`` - Optional, required for EOI flow handlers
- ``irq_retrigger`` - Optional
- ``irq_set_type`` - Optional
- ``irq_set_wake`` - Optional
These primitives are strictly intended to mean what they say: ack means
ACK, masking means masking of an IRQ line, etc. It is up to the flow
handler(s) to use these basic units of low-level functionality.
__do_IRQ entry point
====================
The original implementation __do_IRQ() was an alternative entry point
for all types of interrupts. It no longer exists.
This handler turned out to be not suitable for all interrupt hardware
and was therefore reimplemented with split functionality for
edge/level/simple/percpu interrupts. This is not only a functional
optimization. It also shortens code paths for interrupts.
Locking on SMP
==============
The locking of chip registers is up to the architecture that defines the
chip primitives. The per-irq structure is protected via desc->lock, by
the generic layer.
Generic interrupt chip
======================
To avoid copies of identical implementations of IRQ chips the core
provides a configurable generic interrupt chip implementation.
Developers should check carefully whether the generic chip fits their
needs before implementing the same functionality slightly differently
themselves.
.. kernel-doc:: kernel/irq/generic-chip.c
:export:
Structures
==========
This chapter contains the autogenerated documentation of the structures
which are used in the generic IRQ layer.
.. kernel-doc:: include/linux/irq.h
:internal:
.. kernel-doc:: include/linux/interrupt.h
:internal:
Public Functions Provided
=========================
This chapter contains the autogenerated documentation of the kernel API
functions which are exported.
.. kernel-doc:: kernel/irq/manage.c
.. kernel-doc:: kernel/irq/chip.c
:export:
Internal Functions Provided
===========================
This chapter contains the autogenerated documentation of the internal
functions.
.. kernel-doc:: kernel/irq/irqdesc.c
.. kernel-doc:: kernel/irq/handle.c
.. kernel-doc:: kernel/irq/chip.c
:internal:
Credits
=======
The following people have contributed to this document:
1. Thomas Gleixner [email protected]
2. Ingo Molnar [email protected]
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
문서 정보
1-9`.. include:: <isonum.txt>`
Linux generic IRQ handling
Copyright © 2005-2010 Thomas Gleixner
Copyright © 2005-2006 Ingo Molnar
Generic IRQ 계층의 목적
10-24Introduction
generic interrupt handling layer는 device driver를 위해 interrupt handling을 완전히 추상화하도록 설계되었습니다. 서로 다른 모든 interrupt controller hardware 유형을 처리할 수 있습니다.
device driver는 generic API function으로 interrupt를 request, enable, disable 및 free합니다. driver는 interrupt hardware 세부 사항을 알 필요가 없으므로 코드를 바꾸지 않고 여러 platform에서 사용할 수 있습니다.
이 문서는 generic IRQ handling layer를 이용해 자신의 아키텍처용 interrupt subsystem을 구현하려는 개발자를 위한 것입니다.
IRQ flow와 chip details의 분리
25-91Rationale
Linux의 초기 interrupt handling 구현은 모든 종류의 interrupt logic을 처리하는 `__do_IRQ()` super-handler를 사용했습니다.
Russell King은 Linux 2.5/2.6의 ARM interrupt handler 구현에 범용적인 handler 집합을 만들면서 여러 유형을 구분했습니다. 구현 과정과 SMP 환경에서 확인된 유형까지 합치면 다음과 같습니다.
- Level type
- Edge type
- Simple type
- Fast EOI type
- Per CPU type
high-level IRQ handler를 유형별로 나누면 각 interrupt type에 맞게 처리 흐름을 최적화할 수 있습니다. 특정 code path의 복잡성이 줄고 해당 유형에 최적화된 처리가 가능해집니다.
초기 generic IRQ 구현은 `hw_interrupt_type` structure의 `->ack`, `->end` 등의 callback으로 super-handler 내부 flow control을 구분했습니다. 이 방식은 flow logic과 low-level hardware logic을 섞고 불필요한 code duplication을 만들었습니다. 예를 들어 i386의 `ioapic_level_irq`와 `ioapic_edge_irq`는 low-level detail을 많이 공유하지만 flow handling은 다릅니다.
더 자연스러운 추상화는 `irq flow`와 `chip details`를 명확히 분리하는 것입니다. 대부분의 아키텍처는 generic `irq flow` method를 사용하고 chip-level specific code만 추가할 수 있습니다. IRQ flow 자체에만 quirk가 필요한 (sub)architecture에도 이 구분이 유용합니다.
각 interrupt descriptor에는 대개 generic implementation 중 하나인 high-level flow handler를 지정합니다. 이 구조는 여러 embedded platform에서 필요한 demultiplexing handler도 쉽게 구현하게 합니다.
분리된 계층은 generic interrupt handling layer를 더 유연하고 확장 가능하게 합니다. 예를 들어 level type에는 generic IRQ-flow를 쓰고 edge type만 (sub)architecture 전용 구현을 사용할 수 있습니다.
기존 구현을 깨뜨리지 않고 새 모델로 전환하기 위해 당시에는 `__do_IRQ()` super-handler도 남겨 두었습니다. 그러나 새 모델은 더 작고 깔끔한 IRQ subsystem을 가능하게 하므로 점차 더 많은 아키텍처가 사용해야 하며, 이 문서의 설명 시점에는 기존 방식이 제거될 예정이었습니다.
알려진 문제와 가정
92-96Known Bugs And Assumptions
없습니다. 잘 유지되기를 바랍니다.
추상화 계층과 제어 흐름
97-122Abstraction layers
interrupt code에는 세 가지 주요 추상화 수준이 있습니다.
- High-level driver API
- High-level IRQ flow handlers
- Chip-level hardware encapsulation
Interrupt control flow
각 interrupt는 `irq_desc` interrupt descriptor structure로 기술됩니다. interrupt는 descriptor structure array에서 대응하는 설명을 선택하는 `unsigned int` 숫자로 참조합니다. descriptor에는 status information과 이 interrupt에 지정된 interrupt flow method 및 interrupt chip structure pointer가 들어 있습니다.
interrupt가 발생하면 low-level architecture code가 `desc->handle_irq()`를 호출해 generic interrupt code로 진입합니다. 이 high-level IRQ handling function은 지정된 chip descriptor가 참조하는 `desc->irq_data.chip` primitive만 사용합니다.
High-level Driver API
123-153High-level Driver API는 다음 함수로 구성됩니다.
- `request_irq()`
- `request_threaded_irq()`
- `free_irq()`
- `disable_irq()`
- `enable_irq()`
- `disable_irq_nosync()` (SMP only)
- `synchronize_irq()` (SMP only)
- `irq_set_irq_type()`
- `irq_set_irq_wake()`
- `irq_set_handler_data()`
- `irq_set_chip()`
- `irq_set_chip_data()`
자세한 내용은 자동 생성된 function documentation을 참조하십시오.
미리 정의된 IRQ flow handler
154-176High-level IRQ flow handlers
generic layer는 다음과 같은 미리 정의된 irq-flow method를 제공합니다.
- `handle_level_irq()`
- `handle_edge_irq()`
- `handle_fasteoi_irq()`
- `handle_simple_irq()`
- `handle_percpu_irq()`
- `handle_edge_eoi_irq()`
- `handle_bad_irq()`
미리 정의되었거나 architecture-specific한 interrupt flow handler는 bootup 또는 device initialization 중에 아키텍처가 특정 interrupt에 지정합니다.
Default flow helper 함수
177-218Default flow implementations / Helper functions
helper function은 chip primitive를 호출하며 default flow implementation에서 사용됩니다. 다음은 단순화한 구현 일부입니다.
default_enable(struct irq_data *data)
{
desc->irq_data.chip->irq_unmask(data);
}
default_disable(struct irq_data *data)
{
if (!delay_disable(data))
desc->irq_data.chip->irq_mask(data);
}
default_ack(struct irq_data *data)
{
chip->irq_ack(data);
}
default_mask_ack(struct irq_data *data)
{
if (chip->irq_mask_ack) {
chip->irq_mask_ack(data);
} else {
chip->irq_mask(data);
chip->irq_ack(data);
}
}
noop(struct irq_data *data)
{
}
Default Level IRQ flow
219-234Default flow handler implementations / Default Level IRQ flow handler
`handle_level_irq`는 level-triggered interrupt의 generic implementation을 제공합니다. 제어 흐름은 단순화하면 다음과 같습니다.
desc->irq_data.chip->irq_mask_ack();
handle_irq_event(desc->action);
desc->irq_data.chip->irq_unmask();
Default Fast EOI IRQ flow
235-246Default Fast EOI IRQ flow handler
`handle_fasteoi_irq`는 handler가 끝날 때 EOI만 필요한 interrupt의 generic implementation을 제공합니다.
handle_irq_event(desc->action);
desc->irq_data.chip->irq_eoi();
Default Edge IRQ flow
247-270Default Edge IRQ flow handler
`handle_edge_irq`는 edge-triggered interrupt의 generic implementation을 제공합니다. running 중 다시 발생한 edge는 pending으로 기록하고, pending이 없어질 때까지 event를 처리합니다.
if (desc->status & running) {
desc->irq_data.chip->irq_mask_ack();
desc->status |= pending | masked;
return;
}
desc->irq_data.chip->irq_ack();
desc->status |= running;
do {
if (desc->status & masked)
desc->irq_data.chip->irq_unmask();
desc->status &= ~pending;
handle_irq_event(desc->action);
} while (desc->status & pending);
desc->status &= ~running;
Simple 및 per-CPU IRQ flow
271-303Default simple IRQ flow handler
`handle_simple_irq`는 simple interrupt의 generic implementation을 제공합니다.
simple flow handler는 handler/chip primitive를 전혀 호출하지 않습니다.
handle_irq_event(desc->action);
Default per CPU flow handler
`handle_percpu_irq`는 per CPU interrupt의 generic implementation을 제공합니다. per CPU interrupt는 SMP에서만 사용할 수 있으며, handler는 locking이 없는 단순화된 형태입니다.
if (desc->irq_data.chip->irq_ack)
desc->irq_data.chip->irq_ack();
handle_irq_event(desc->action);
if (desc->irq_data.chip->irq_eoi)
desc->irq_data.chip->irq_eoi();
Edge EOI, bad IRQ와 delayed disable
304-343EOI Edge IRQ flow handler
`handle_edge_eoi_irq`는 powerpc/cell의 심하게 손상된 irq controller를 다루기 위해서만 사용하는 edge handler의 특수 변형입니다.
Bad IRQ flow handler
`handle_bad_irq`는 실제 handler가 지정되지 않은 spurious interrupt에 사용합니다.
Quirks and optimizations
generic function은 platform-specific IRQ handling quirk가 없는 clean architecture와 chip을 대상으로 합니다. flow level quirk가 필요하면 high-level irq-flow handler를 override할 수 있습니다.
Delayed interrupt disable
Russell King이 ARM interrupt 구현에 도입한 이 per-interrupt 선택 기능은 `disable_irq()` 호출 시 hardware level에서 즉시 interrupt를 mask하지 않습니다. interrupt를 활성 상태로 두고 event가 발생했을 때 flow handler에서 mask합니다.
이 방식은 hardware level에서 interrupt가 비활성화된 동안 edge event를 저장하지 못하는 hardware에서 edge interrupt 손실을 막습니다. `IRQ_DISABLED` flag가 설정된 상태로 interrupt가 도착하면 hardware에서 mask하고 `IRQ_PENDING` bit를 설정합니다.
`enable_irq()`로 다시 활성화할 때 pending bit를 확인하고 설정되어 있으면 hardware 또는 software resend mechanism으로 interrupt를 다시 보냅니다. hardware가 retrigger를 지원하지 않으면 `CONFIG_HARDIRQS_SW_RESEND`가 필요합니다. delayed interrupt disable 자체는 구성할 수 없습니다.
Chip-level hardware encapsulation
344-370Chip-level hardware encapsulation
chip-level hardware descriptor인 `irq_chip` structure에는 irq flow implementation이 사용할 수 있는 chip 직접 관련 function이 모두 들어 있습니다.
- `irq_ack`
- `irq_mask_ack` (optional, performance를 위해 권장)
- `irq_mask`
- `irq_unmask`
- `irq_eoi` (optional, EOI flow handler에는 필수)
- `irq_retrigger` (optional)
- `irq_set_type` (optional)
- `irq_set_wake` (optional)
이 primitive는 이름 그대로의 의미만 갖습니다. ack는 ACK, masking은 IRQ line masking을 뜻합니다. 이 low-level 기본 단위를 어떻게 조합할지는 flow handler가 결정합니다.
__do_IRQ 제거와 SMP locking
371-388__do_IRQ entry point
초기 구현의 `__do_IRQ()`는 모든 interrupt type을 위한 대체 entry point였지만 더 이상 존재하지 않습니다. 모든 interrupt hardware에 적합하지 않아 edge, level, simple, percpu interrupt별 기능으로 분리해 다시 구현했습니다. 이는 기능 최적화일 뿐 아니라 interrupt code path도 줄입니다.
Locking on SMP
chip register locking은 chip primitive를 정의하는 아키텍처가 담당합니다. per-irq structure는 generic layer가 `desc->lock`으로 보호합니다.
Generic interrupt chip
389-400Generic interrupt chip
동일한 IRQ chip 구현이 복제되는 것을 막기 위해 core는 구성 가능한 generic interrupt chip implementation을 제공합니다. 개발자는 같은 기능을 조금 다르게 직접 구현하기 전에 generic chip이 요구 사항에 맞는지 신중히 확인해야 합니다.
.. kernel-doc:: kernel/irq/generic-chip.c
:export:
Generic IRQ 구조체
401-412Structures
이 절은 generic IRQ layer에서 사용하는 structure의 자동 생성 문서를 포함합니다.
.. kernel-doc:: include/linux/irq.h
:internal:
.. kernel-doc:: include/linux/interrupt.h
:internal:
공개 함수 참조
413-423Public Functions Provided
이 절은 export된 kernel API function의 자동 생성 문서를 포함합니다.
.. kernel-doc:: kernel/irq/manage.c
.. kernel-doc:: kernel/irq/chip.c
:export:
내부 함수 참조
424-436Internal Functions Provided
이 절은 internal function의 자동 생성 문서를 포함합니다.
.. kernel-doc:: kernel/irq/irqdesc.c
.. kernel-doc:: kernel/irq/handle.c
.. kernel-doc:: kernel/irq/chip.c
:internal:
기여자
437-444Credits
다음 사람들이 이 문서에 기여했습니다.
- Thomas Gleixner <[email protected]>
- Ingo Molnar <[email protected]>
요약과 해설
genericirq.rst:1-444generic IRQ 계층은 device driver가 interrupt controller 세부 사항과 무관하게 IRQ를 요청하고 제어하도록 합니다. 핵심 설계는 high-level IRQ flow와 low-level chip primitive를 분리하는 것입니다.
각 `irq_desc`는 `handle_irq` flow handler와 `irq_chip`을 연결합니다. level, edge, fast EOI, simple, per-CPU 등 interrupt 성격에 맞춘 handler가 ack, mask, unmask, EOI primitive를 올바른 순서로 조합합니다.
아키텍처는 chip register locking과 필요한 flow quirk를 책임지고 generic layer는 `desc->lock`으로 per-IRQ 상태를 보호합니다. generic interrupt chip과 kernel-doc API를 먼저 활용하면 중복 구현을 줄일 수 있습니다.