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

    Ben Wolsieffer
     

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

    Rob Herring
     

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

    Antonio Borneo
     
  • 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

    Marek Vasut
     

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

    Antonio Borneo
     

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.o

    Signed-off-by: Antonio Borneo
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20220606162757.415354-7-antonio.borneo@foss.st.com

    Antonio Borneo
     
  • 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.o

    Signed-off-by: Antonio Borneo
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20220606162757.415354-6-antonio.borneo@foss.st.com

    Antonio Borneo
     
  • 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

    Alexandre Torgue
     
  • 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

    Antonio Borneo
     
  • 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

    Loic Pallardy
     
  • 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

    Ludovic Barre
     

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

    Alexandre Torgue
     

19 Oct, 2021

1 commit


10 Jun, 2021

1 commit


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

    Zhen Lei
     

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 83

    Signed-off-by: Erwan Le Ray
    Signed-off-by: Marc Zyngier
    Link: https://lore.kernel.org/r/20210319184253.5841-4-erwan.leray@foss.st.com

    Erwan Le Ray
     

25 Oct, 2020

1 commit


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

    qiuguorui1
     

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

    Alexandre Torgue
     
  • 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

    Fabien Dessenne
     

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

    Alexandre Torgue
     

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

    Fabien Dessenne
     

21 Mar, 2019

3 commits


18 Jan, 2019

1 commit


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

    Benjamin Gaignard
     

13 Dec, 2018

1 commit


24 Aug, 2018

1 commit


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

    Dan Carpenter
     

19 Jul, 2018

1 commit


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

    Arnd Bergmann
     

24 May, 2018

8 commits