From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BAA737AA71; Mon, 9 Feb 2026 14:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648292; cv=none; b=EOvxjs+2CoEkel8LWllg7MRIn/5zVgJthix/Tn2rCglI09L6fEifOgXnEnAbcQ3/5e1wcFY1bFLcuof5vdonf740cn6U03FnIgvnnoN4KLvyJMpd1HNK6c7p17LS3Ge3Hu1PUvrLujT+Ojex7Zq9epa0A+zPSBmlHVvQCDJ33z4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770648292; c=relaxed/simple; bh=UrqIA+51wcYcVRhbzKCfsvkT1UFDTKGmAGRVDPNrpuk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UpYVe0tnsailahOoxVmxX+9T7/MOUnFOG8T4m9e2obpmvmeb/pKM89nUS0Oh8qABe9zOVwqAkYqCmpyVpdGVaIXdhEfWnR4U7B3OY7JrKWnismTht1sWyuzVy5wRgJ/TTYq2VheXkJai2mFKdLRYVgJKmB+xRDZpXTtgtrT0KpY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wnj7NKxB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wnj7NKxB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C100C116C6; Mon, 9 Feb 2026 14:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770648291; bh=UrqIA+51wcYcVRhbzKCfsvkT1UFDTKGmAGRVDPNrpuk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wnj7NKxB1n9OPmhT2EbHJtUwBHZ8yOFQOhtjcFd9iz9RCOODdb5douJ+SbXSNAzw2 +xXT/vt5KI7DLUjELasxT3zNY0Zzy3HS0QOgFwUusfryG316ayJt3EkzaHRhKzMb8V lpaFdX5qFU7p2GyMfgFDCNcy91xn0G9NB1YbGmGQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Breno Leitao , Usama Arif , Jon Hunter , Thierry Reding , Mark Brown , Sasha Levin Subject: [PATCH 6.1 63/69] spi: tegra210-quad: Return IRQ_HANDLED when timeout already processed transfer Date: Mon, 9 Feb 2026 15:24:31 +0100 Message-ID: <20260209142304.192340863@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260209142301.913348974@linuxfoundation.org> References: <20260209142301.913348974@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Breno Leitao [ Upstream commit aabd8ea0aa253d40cf5f20a609fc3d6f61e38299 ] When the ISR thread wakes up late and finds that the timeout handler has already processed the transfer (curr_xfer is NULL), return IRQ_HANDLED instead of IRQ_NONE. Use a similar approach to tegra_qspi_handle_timeout() by reading QSPI_TRANS_STATUS and checking the QSPI_RDY bit to determine if the hardware actually completed the transfer. If QSPI_RDY is set, the interrupt was legitimate and triggered by real hardware activity. The fact that the timeout path handled it first doesn't make it spurious. Returning IRQ_NONE incorrectly suggests the interrupt wasn't for this device, which can cause issues with shared interrupt lines and interrupt accounting. Fixes: b4e002d8a7ce ("spi: tegra210-quad: Fix timeout handling") Signed-off-by: Breno Leitao Signed-off-by: Usama Arif Tested-by: Jon Hunter Acked-by: Jon Hunter Acked-by: Thierry Reding Link: https://patch.msgid.link/20260126-tegra_xfer-v2-1-6d2115e4f387@debian.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-tegra210-quad.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c index 2e4d1b2f2a273..024e1468eee8d 100644 --- a/drivers/spi/spi-tegra210-quad.c +++ b/drivers/spi/spi-tegra210-quad.c @@ -1435,15 +1435,30 @@ static irqreturn_t handle_dma_based_xfer(struct tegra_qspi *tqspi) static irqreturn_t tegra_qspi_isr_thread(int irq, void *context_data) { struct tegra_qspi *tqspi = context_data; + u32 status; + + /* + * Read transfer status to check if interrupt was triggered by transfer + * completion + */ + status = tegra_qspi_readl(tqspi, QSPI_TRANS_STATUS); /* * Occasionally the IRQ thread takes a long time to wake up (usually * when the CPU that it's running on is excessively busy) and we have * already reached the timeout before and cleaned up the timed out * transfer. Avoid any processing in that case and bail out early. + * + * If no transfer is in progress, check if this was a real interrupt + * that the timeout handler already processed, or a spurious one. */ - if (!tqspi->curr_xfer) - return IRQ_NONE; + if (!tqspi->curr_xfer) { + /* Spurious interrupt - transfer not ready */ + if (!(status & QSPI_RDY)) + return IRQ_NONE; + /* Real interrupt, already handled by timeout path */ + return IRQ_HANDLED; + } tqspi->status_reg = tegra_qspi_readl(tqspi, QSPI_FIFO_STATUS); -- 2.51.0