From patchwork Tue Aug 4 19:51:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 11700963 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC3C2913 for ; Tue, 4 Aug 2020 20:10:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B2F5C22B45 for ; Tue, 4 Aug 2020 20:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726113AbgHDUKG (ORCPT ); Tue, 4 Aug 2020 16:10:06 -0400 Received: from mail.manjaro.org ([176.9.38.148]:34408 "EHLO mail.manjaro.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbgHDUKG (ORCPT ); Tue, 4 Aug 2020 16:10:06 -0400 X-Greylist: delayed 1088 seconds by postgrey-1.27 at vger.kernel.org; Tue, 04 Aug 2020 16:10:05 EDT Received: from localhost (localhost [127.0.0.1]) by mail.manjaro.org (Postfix) with ESMTP id 1426B1213A5; Tue, 4 Aug 2020 21:51:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at manjaro.org Received: from mail.manjaro.org ([127.0.0.1]) by localhost (manjaro.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E-eNW1UPt2mP; Tue, 4 Aug 2020 21:51:53 +0200 (CEST) From: Tobias Schramm To: Mark Brown , Maxime Coquelin , Alexandre Torgue Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Tobias Schramm Subject: [PATCH] spi: stm32: clear only asserted irq flags on interrupt Date: Tue, 4 Aug 2020 21:51:36 +0200 Message-Id: <20200804195136.1485392-1-t.schramm@manjaro.org> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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 --- drivers/spi/spi-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);