drivers: stm32-exti: do not lock hwsem on irq disable

Remove the HWSEM locking around stm32_exti_disable().

The STM32 EXTI driver uses the core-local interrupt mask regsiters on
STM32H7x7 asym. dualcore MCUs. There is no need to lock the HWSEM
guarding the EXTI when accessing these registers.

Some sensor drivers toggle their interrupt mask every time the sensor
triggers the IRQ line. Locking the HWSEM fails e.g. in situations where
one coprocessor serivces the sensor and the other coprocessor sets up
its interrupts initially during bootup. This prevents the sensor driver
from locking the HWSEM and causes a kernel panic on the corresponding
CPU.

Note: The opposing stm32_exti_enable() was already correctly without
locking.

Signed-off-by: Martin Gritzan <martin.gritzan@gmail.com>
This commit is contained in:
Martin Gritzan 2023-10-18 14:02:09 +02:00 committed by Carles Cufí
parent 765b31979f
commit ff2b827143

View file

@ -73,8 +73,6 @@ void stm32_exti_enable(int line)
void stm32_exti_disable(int line)
{
z_stm32_hsem_lock(CFG_HW_EXTI_SEMID, HSEM_LOCK_DEFAULT_RETRY);
if (line < 32) {
#if defined(CONFIG_SOC_SERIES_STM32H7X) && defined(CONFIG_CPU_CORTEX_M4)
LL_C2_EXTI_DisableIT_0_31(BIT((uint32_t)line));
@ -84,7 +82,6 @@ void stm32_exti_disable(int line)
} else {
__ASSERT_NO_MSG(line);
}
z_stm32_hsem_unlock(CFG_HW_EXTI_SEMID);
}
/**