]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
spi: stm32: clear only asserted irq flags on interrupt
authorTobias Schramm <t.schramm@manjaro.org>
Tue, 4 Aug 2020 19:51:36 +0000 (21:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:26:56 +0000 (11:26 +0200)
[ Upstream commit ae1ba50f1e706dfd7ce402ac52c1f1f10becad68 ]

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 <t.schramm@manjaro.org>
Link: https://lore.kernel.org/r/20200804195136.1485392-1-t.schramm@manjaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-stm32.c

index 7e92ab0cc99200ab1833826646e4c3a9002076f8..dc6334f67e6ae5f9eb7250bd6b8c12ebdd9aec96 100644 (file)
@@ -962,7 +962,7 @@ static irqreturn_t stm32h7_spi_irq_thread(int irq, void *dev_id)
                if (!spi->cur_usedma && (spi->rx_buf && (spi->rx_len > 0)))
                        stm32h7_spi_read_rxfifo(spi, false);
 
-       writel_relaxed(mask, spi->base + STM32H7_SPI_IFCR);
+       writel_relaxed(sr & mask, spi->base + STM32H7_SPI_IFCR);
 
        spin_unlock_irqrestore(&spi->lock, flags);