diff mbox series

spi: stm32: clear only asserted irq flags on interrupt

Message ID 20200804195136.1485392-1-t.schramm@manjaro.org (mailing list archive)
State Accepted
Commit ae1ba50f1e706dfd7ce402ac52c1f1f10becad68
Headers show
Series spi: stm32: clear only asserted irq flags on interrupt | expand

Commit Message

Tobias Schramm Aug. 4, 2020, 7:51 p.m. UTC
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>
---
 drivers/spi/spi-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown Aug. 5, 2020, 3:55 p.m. UTC | #1
On Tue, 4 Aug 2020 21:51:36 +0200, Tobias Schramm wrote:
> 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.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: stm32: clear only asserted irq flags on interrupt
      commit: ae1ba50f1e706dfd7ce402ac52c1f1f10becad68

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 4c643dfc7fbb..4a21feae0103 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -966,7 +966,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);