Antonio Borneo a80cd507b5 irqchip/stm32-exti: Re-enable irq detection in irq_eoi
EXTI interrupt controller is based on input edge detection.
Each bit in EXTI Interrupt Mask Register (IMR) disables the edge
detection while masking the interrupt.

The current code can fail detecting an interrupt in the following
setup:
- the interrupt client of EXTI requests a threaded interrupt;
- the EXTI interrupt line is of "configurable" event type, which
  means that EXTI is responsible to detect the input's edge and to
  propagate the interrupt to the parent irq_chip (GIC);
- a second interrupt (the one that will be lost) arrives while
  handling a previous interrupt, as explained below.

The interrupt client of EXTI requests a threaded interrupt and uses
the flag IRQF_ONESHOT. To serve interrupts, the EXTI irq_eoi()
will be called with interrupt masked; irq_mask() will be executed
before irq_eoi() and irq_unmask() will be executed later on, after
the threaded handler of the client.
If the interrupt client suddenly re-triggers the interrupt between
the end of its threaded handler and the EXTI irq_unmask(), EXTI
will miss the interrupt.

For "configurable" events, EXTI uses GIC as hierarchically parent
interrupt controller and GIC is able to mask the interrupts that
arrive from EXTI. This makes possible to re-enable the EXTI IMR
bit during irq_eoi(); the GIC will take care of masking an incoming
interrupt from EXTI.

Re-enable the IMR bit in irq_eoi() to detect the edge of the
interrupt before irq_unmask() is called.

Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com>
Change-Id: I80a8c31a8a5a91672fc5d1d1794623f0113b7fb3
Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/297836
ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com>
ACI: CIBUILD <MDG-smet-aci-builds@list.st.com>
Tested-by: Antonio Maria BORNEO <antonio.borneo@st.com>
Reviewed-by: Antonio Maria BORNEO <antonio.borneo@st.com>
Reviewed-by: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
Domain-Review: Amelie DELAUNAY <amelie.delaunay@foss.st.com>
2023-06-16 11:58:57 +02:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 4.1 GiB
Languages
C 97.7%
Assembly 1.2%
Shell 0.4%
Makefile 0.3%
Python 0.2%
Other 0.1%