Skip to content

Commit ae1ba50

Browse files
TobleMinerbroonie
authored andcommitted
spi: stm32: clear only asserted irq flags on interrupt
Previously the stm32h7 interrupt thread cleared all non-masked interrupts. If an interrupt was to occur during the handling of another interrupt its flag would be unset, resulting in a lost interrupt. This patches fixes the issue by clearing only the currently set interrupt flags. Signed-off-by: Tobias Schramm <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ddf75be commit ae1ba50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi-stm32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
966966
if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0)))
967967
stm32h7_spi_read_rxfifo(spi, false);
968968

969-
writel_relaxed(mask, spi->base + STM32H7_SPI_IFCR);
969+
writel_relaxed(sr & mask, spi->base + STM32H7_SPI_IFCR);
970970

971971
spin_unlock_irqrestore(&spi->lock, flags);
972972

0 commit comments

Comments
 (0)