07 Oct, 2023
1 commit
-
The STM32F4/7 EXTI driver was missing the xlate callback, so IRQ trigger
flags specified in the device tree were being ignored. This was
preventing the RTC alarm interrupt from working, because it must be set
to trigger on the rising edge to function correctly.Signed-off-by: Ben Wolsieffer
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20231003162003.1649967-1-ben.wolsieffer@hefring.com
22 Aug, 2023
1 commit
-
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.Signed-off-by: Rob Herring
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20230714174645.4058547-1-robh@kernel.org
17 Jun, 2023
2 commits
-
While compiling with W=1, both gcc and clang complain about a
tricky way to initialize an array by filling it with a non-zero
value and then overrride some of the array elements.
In this case the override is intentional, so just disable the
specific warning for only this part of the code.Note: the flag "-Woverride-init" is recognized by both compilers,
but the warning msg from clang reports "-Winitializer-overrides".
The doc of clang clarifies that the two flags are synonyms, so use
here only the flag name common on both compilers.Signed-off-by: Antonio Borneo
Fixes: c297493336b7 ("irqchip/stm32-exti: Simplify irq description table")
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20230601155614.34490-1-antonio.borneo@foss.st.com -
The EXTI interrupt 46 is mapped to GIC interrupt 151. Add the
missing mapping, which is used for IWDG2 pretimeout interrupt
and wake up source.Reviewed-by: Antonio Borneo
Signed-off-by: Marek Vasut
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20230517194349.105745-1-marex@denx.de
12 Sep, 2022
1 commit
-
The field drv_data is assigned during driver's probe, where it's
already checked to be not NULL.Remove the always false check '!host_data->drv_data'.
This fixes a warning "variable dereferenced before check" detected
by '0-DAY CI Kernel Test Service'.Fixes: c297493336b7 ("irqchip/stm32-exti: Simplify irq description table")
Reported-by: kernel test robot
Reported-by: Dan Carpenter
Link: https://lore.kernel.org/lkml/202208131739.gJvcs9ls-lkp@intel.com/
Signed-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220817125758.5975-1-antonio.borneo@foss.st.com
07 Jul, 2022
6 commits
-
Having removed the event trigger type from struct stm32_desc_irq
makes worthless keep using a struct.Replace the struct by a single dimension array and use 8 bit type
to reduce the overal memory footprint.
On armv7a this patch reduces by 7% the size of the driver, from
text data bss dec hex filename
6977 424 4 7405 1ced irq-stm32-exti.o
to
6449 424 4 6877 1add irq-stm32-exti.oSigned-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-7-antonio.borneo@foss.st.com -
The flag reporting whether an event is 'direct' or 'configurable'
is available in the read-only registers EVENT_TRG.Drop this redundant information from the struct stm32_desc_irq and
use the proper bit from EVENT_TRG register.
On armv7a this patch reduces by 3% the size of the driver, from
text data bss dec hex filename
7233 424 4 7661 1ded irq-stm32-exti.o
to
6977 424 4 7405 1ced irq-stm32-exti.oSigned-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-6-antonio.borneo@foss.st.com -
The reference manual RM0436 of stm32mp15 till version v4.0 was
erroneously reporting the Event Mask Registers (EMR) for the
Cortex-A CPUs.
These registers have been removed from v5.0 of the manual and the
corresponding offsets have been marked as 'Reserved'.Prevent accessing these reserved addresses by tagging the EMR
offsets as UNDEF_REG and modifying the code to handle this case.Signed-off-by: Alexandre Torgue
Signed-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-5-antonio.borneo@foss.st.com -
The value hwirq is received from DT. If it exceeds the maximum
valid value it causes the code to address unexisting irq chips
reading outside the array boundary.Check the value of hwirq before using it.
Signed-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-4-antonio.borneo@foss.st.com -
The driver has to mask/unmask the corresponding flag in the
Interrupt Mask Register (IMR).
This is already done for configurable event, while direct events
only forward the mask/unmask request to the parent.Use the existing stm32_exti_h_mask()/stm32_exti_h_unmask() for
direct events too.Signed-off-by: Loic Pallardy
Signed-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-3-antonio.borneo@foss.st.com -
When there is no parent, there is no specific action to do in
stm32-exti irqchip. In such case, it's incorrect returning an
error.Let irq_set_affinity to return IRQ_SET_MASK_OK_DONE when there is
no parent.Signed-off-by: Ludovic Barre
Signed-off-by: Antonio Borneo
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220606162757.415354-2-antonio.borneo@foss.st.com
09 Feb, 2022
1 commit
-
Enhance stm32-exti driver to support STM32MP13 SoC. This SoC uses the same
hardware version than STM32MP15. Only EXTI line mapping is changed and
following EXTI lines are supported: GPIO, RTC, I2C[1-5], UxART[1-8],
USBH_EHCI, USBH_OHCI, USB_OTG, LPTIM[1-5], ETH[1-2].Signed-off-by: Alexandre Torgue
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20220202140005.860-3-alexandre.torgue@foss.st.com
19 Oct, 2021
1 commit
-
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separatelySigned-off-by: Cai Huoqing
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20210908105715.1780-1-caihuoqing@baidu.com
10 Jun, 2021
1 commit
-
Wherever possible, replace constructs that match either
generic_handle_irq(irq_find_mapping()) or
generic_handle_irq(irq_linear_revmap()) to a single call to
generic_handle_domain_irq().Reviewed-by: Geert Uytterhoeven
Acked-by: Krzysztof Kozlowski
Signed-off-by: Marc Zyngier
16 May, 2021
1 commit
-
When devm_ioremap_resource() fails, a clear enough error message will be
printed by its subfunction __devm_ioremap_resource(). The error
information contains the device name, failure cause, and possibly resource
information.Therefore, remove the error printing here to simplify code and reduce the
binary size.Reported-by: Hulk Robot
Signed-off-by: Zhen Lei
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20210511125428.6108-2-thunder.leizhen@huawei.com
07 Apr, 2021
1 commit
-
Add following usart instances exti direct event support (used for UART wake
up).
- exti 26 (USART1) is mapped to GIC 37
- exti 27 (USART2) is mapped to GIC 38
- exti 28 (USART3) is mapped to GIC 39
- exti 29 (USART6) is mapped to GIC 71
- exti 31 (UART5) is mapped to GIC 53
- exti 32 (UART7) is mapped to GIC 82
- exti 33 (UART8) is mapped to GIC 83Signed-off-by: Erwan Le Ray
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20210319184253.5841-4-erwan.leray@foss.st.com
25 Oct, 2020
1 commit
-
Add all remaining LP timer exti direct events, e.g. for LP Timer 2 to 5.
LP timer 1 is already listed (e.g. exti 47).Signed-off-by: Fabrice Gasnier
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/1602859219-15684-2-git-send-email-fabrice.gasnier@st.com
25 Aug, 2020
1 commit
-
In the current code, when the eoi callback of the exti clears the pending
bit of the current interrupt, it will first read the values of fpr and
rpr, then logically OR the corresponding bit of the interrupt number,
and finally write back to fpr and rpr.We found through experiments that if two exti interrupts,
we call them int1/int2, arrive almost at the same time. in our scenario,
the time difference is 30 microseconds, assuming int1 is triggered first.there will be an extreme scenario: both int's pending bit are set to 1,
the irq handle of int1 is executed first, and eoi handle is then executed,
at this moment, all pending bits are cleared, but the int 2 has not
finally been reported to the cpu yet, which eventually lost int2.According to stm32's TRM description about rpr and fpr: Writing a 1 to this
bit will trigger a rising edge event on event x, Writing 0 has no
effect.Therefore, when clearing the pending bit, we only need to clear the
pending bit of the irq.Fixes: 927abfc4461e7 ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: qiuguorui1
Signed-off-by: Marc Zyngier
Cc: stable@vger.kernel.org # v4.18+
Link: https://lore.kernel.org/r/20200820031629.15582-1-qiuguorui1@huawei.com
27 Jul, 2020
2 commits
-
EXTI lines are mainly used to wake-up system from CStop low power mode.
Currently, if a device wants to use a EXTI (direct) line as wakeup line,
it has to declare 2 interrupts:
- one for EXTI used to wake-up system (with dedicated_wake_irq api).
- one for GIC used to get the wake up reason inside the concerned IP.This split is not really needed as each EXTI line is actually "linked " to
a GIC. So to avoid this useless double interrupt management in each
wake-up driver, this patch lets the STM32 EXTI driver abstract it by
mapping each EXTI line to his corresponding GIC.Signed-off-by: Alexandre Torgue
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20200717140717.29606-1-alexandre.torgue@st.com -
Now that the hwspin_lock_timeout_in_atomic() API is available use it.
Signed-off-by: Fabien Dessenne
Signed-off-by: Alexandre Torgue
Signed-off-by: Marc Zyngier
Link: https://lore.kernel.org/r/20200706081115.25180-1-alexandre.torgue@st.com
08 Mar, 2020
1 commit
-
This commit introduces retrigger support for stm32_ext_h chip.
It consists to rise the GIC interrupt mapped to an EXTI line.Signed-off-by: Alexandre Torgue
Signed-off-by: Marc Zyngier
Tested-by: Marek Vasut
Link: https://lore.kernel.org/r/20200219143229.18084-2-alexandre.torgue@st.com
29 Apr, 2019
1 commit
-
This irqchip driver uses the hwspinlock framework (coprocessor HW regs
access concurrency) for the stm32mp1-exti device.
Hence, this driver needs to handle the hwspinlock driver dependency
using the deferred probe mechanism which requires to move this driver
into a platform one with a probe() ops.
This applies only for the device which is "st,stm32mp1-exti" compatible,
the management of the other devices (st,stm32h7-exti / st,stm32-exti) is
kept unchanged (use IRQCHIP_DECLARE)Signed-off-by: Fabien Dessenne
Signed-off-by: Marc Zyngier
21 Mar, 2019
3 commits
-
…rm-platforms into irq/urgent
Pull irqchip updates for 5.1 from Marc Zyngier:
- irqsteer error handling fix
- GICv3 range coalescing fix
- stm32 coprocessor coexistence fixes
- mbigen MSI teardown fix
- non-DT secondary GIC infrastructure removed
- various cleanups (brcmstb-l2, mmp)
- new DT bindings (r8a774c0) -
The rising configuration status register (rtsr) is not banked.
As it is shared with the co-processor, it should not be written at probe
time, else the co-processor configuration will be lost.Fixes: f9fc1745501e ("irqchip/stm32: Add host and driver data structures")
Signed-off-by: Fabien Dessenne
Signed-off-by: Marc Zyngier -
Falling and rising configuration and status registers are not banked.
As they are shared with M4 co-processor, they should not be cleared
at probe time, else M4 co-processor configuration will be lost.Fixes: f9fc1745501e ("irqchip/stm32: Add host and driver data structures")
Signed-off-by: Loic Pallardy
Signed-off-by: Fabien Dessenne
Signed-off-by: Marc Zyngier
18 Jan, 2019
1 commit
-
Domain translate function is needed to recover irq
configuration parameters from DT nodeFixes: 927abfc4461e ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: Loic Pallardy
Signed-off-by: Marc Zyngier
18 Dec, 2018
1 commit
-
If a hwspinlock is defined in device tree use it to protect
configuration registers.Do not request for hwspinlock during the exti driver init since the
hwspinlock driver is not probed yet at that stage and the exti driver
does not support deferred probe.
Instead of this, postpone the hwspinlock request at the first time the
hwspinlock is actually needed.Use the hwspin_trylock_raw() API which is the most appropriated here
Indeed:
- hwspin_lock_() calls are under spin_lock protection (chip_data->rlock
or gc->lock).
- the _timeout() API relies on jiffies count which won't work if IRQs
are disabled which is the case here (a large part of the IRQ setup is
done atomically (see irq/manage.c))
As a consequence implement the retry/timeout lock from here. And since
all of this is done atomically, reduce the timeout delay to 1 ms.Signed-off-by: Benjamin Gaignard
Signed-off-by: Fabien Dessenne
Signed-off-by: Marc Zyngier
13 Dec, 2018
1 commit
-
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.Signed-off-by: Yangtao Li
Signed-off-by: Marc Zyngier
24 Aug, 2018
1 commit
-
…arm-platforms into irq/urgent
Pull irqchip updates for 4.19, take #2 from Marc Zyngier:
- bcm7038: compilation fix for !SMP
- stm32: fix teardown on probe error
- s3c24xx: fix compilation warning
- renesas-irqc: r8a774a1 support
- tango: chained irq setup simplification
- gic-v3: allow wake-up sources
13 Aug, 2018
1 commit
-
If there are any errors in stm32_exti_host_init() then it leads to a
NULL dereference in the callers. The function should clean up after
itself.Fixes: f9fc1745501e ("irqchip/stm32: Add host and driver data structures")
Reviewed-by: Ludovic Barre
Signed-off-by: Dan Carpenter
Signed-off-by: Marc Zyngier
19 Jul, 2018
1 commit
-
This patch fixes a datasheet issue, in the draft version the "exti0"
was not connected whereas is it.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier
06 Jun, 2018
1 commit
-
A CONFIG_SMP=n build emits a harmless compile-time warning:
drivers/irqchip/irq-stm32-exti.c:495:12: error: 'stm32_exti_h_set_affinity' defined but not used [-Werror=unused-function]
The #ifdef is inconsistent here, and it's better to use an IS_ENABLED() check
that lets the compiler silently drop that function.Fixes: 927abfc4461e ("irqchip/stm32: Add stm32mp1 support with hierarchy domain")
Signed-off-by: Arnd Bergmann
Signed-off-by: Thomas Gleixner
Reviewed-by: Ludovic Barre
Cc: Rob Herring
Cc: Benjamin Gaignard
Cc: Radoslaw Pietrzyk
Cc: Jason Cooper
Cc: Marc Zyngier
Cc: linux-arm-kernel@lists.infradead.org
Cc: Maxime Coquelin
Cc: Alexandre Torgue
Link: https://lkml.kernel.org/r/20180605114347.1347128-1-arnd@arndb.de
24 May, 2018
8 commits
-
This patch adds suspend/resume feature for exti hierarchy domain.
-suspend function sets wake_active into imr of each banks
-resume function restores the mask_cache interrupt into
imr of each banksSigned-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
Exti controller has been differently integrated on stm32mp1 SoC.
A parent irq has only one external interrupt. A hierachy domain could
be used. Handlers are call by parent, each parent interrupt could be
masked and unmasked according to the needs.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
This patch prepares functions which could be reused by
next variant of stm32 exti controller.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
This patch adds host and driver data structures to support
different stm32 exti controllers with variants.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
This patch adds suspend feature.
-Use default irq_set_wake function to store wakeup request.
-Suspend function set wake_active into imr of each bank
and save rising/falling trigger registers.
-Resume function restore the mask_cache interrupt into
imr of each bank and restore rising/falling trigger registers.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
This patch adds support of rising/falling pending registers.
Falling pending register (fpr) is needed for next revision.Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
-WARNING: struct irq_domain_ops should normally be const
-CHECK: Alignment should match open parenthesisSigned-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier -
- In stm32_exti_alloc function, discards irq_domain_set_info
with handle_simple_irq. This overwrite the setting defined while init
of generic chips. Exti controller manages edge irq type.
- Removes acking in chained irq handler as this is done by
irq_chip itself inside handle_edge_irq
- removes unneeded irq_domain_ops.xlate callbackAcked-by: Ludovic Barre
Tested-by: Ludovic Barre
Signed-off-by: Radoslaw Pietrzyk
Signed-off-by: Ludovic Barre
Signed-off-by: Marc Zyngier