mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR
@ 2026-03-13 16:19 Praveen Talari
  2026-03-17 16:52 ` Konrad Dybcio
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Praveen Talari @ 2026-03-13 16:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-arm-msm, linux-spi, linux-kernel, bjorn.andersson,
	konrad.dybcio, mukesh.savaliya, jyothi.seerapu, praveen.talari

The current interrupt handler only checks the GENI main IRQ status
(m_irq) before deciding to return IRQ_NONE. This can lead to spurious
IRQ_NONE returns when DMA interrupts are pending but m_irq is zero.

Move the DMA TX/RX status register reads to the beginning of the ISR,
right after reading m_irq. Update the early return condition to check
all three status registers (m_irq, dma_tx_status, dma_rx_status) before
returning IRQ_NONE.

Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
---
 drivers/spi/spi-geni-qcom.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 43ce47f2454c..69d26e23628c 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -906,10 +906,13 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 	struct spi_controller *spi = data;
 	struct spi_geni_master *mas = spi_controller_get_devdata(spi);
 	struct geni_se *se = &mas->se;
-	u32 m_irq;
+	u32 m_irq, dma_tx_status, dma_rx_status;
 
 	m_irq = readl(se->base + SE_GENI_M_IRQ_STATUS);
-	if (!m_irq)
+	dma_tx_status = readl_relaxed(se->base + SE_DMA_TX_IRQ_STAT);
+	dma_rx_status = readl_relaxed(se->base + SE_DMA_RX_IRQ_STAT);
+
+	if (!m_irq && !dma_tx_status && !dma_rx_status)
 		return IRQ_NONE;
 
 	if (m_irq & (M_CMD_OVERRUN_EN | M_ILLEGAL_CMD_EN | M_CMD_FAILURE_EN |
@@ -957,8 +960,6 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
 		}
 	} else if (mas->cur_xfer_mode == GENI_SE_DMA) {
 		const struct spi_transfer *xfer = mas->cur_xfer;
-		u32 dma_tx_status = readl_relaxed(se->base + SE_DMA_TX_IRQ_STAT);
-		u32 dma_rx_status = readl_relaxed(se->base + SE_DMA_RX_IRQ_STAT);
 
 		if (dma_tx_status)
 			writel(dma_tx_status, se->base + SE_DMA_TX_IRQ_CLR);

---
base-commit: 5c9e55fecf9365890c64f14761a80f9413a3b1d1
change-id: 20260313-spi-geni-qcom-fix-dma-irq-handling-5f8a7755cfa4

Best regards,
-- 
Praveen Talari <praveen.talari@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR
  2026-03-13 16:19 [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR Praveen Talari
@ 2026-03-17 16:52 ` Konrad Dybcio
  2026-03-17 17:08 ` Mark Brown
  2026-03-17 18:10 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2026-03-17 16:52 UTC (permalink / raw)
  To: Praveen Talari, Mark Brown
  Cc: linux-arm-msm, linux-spi, linux-kernel, bjorn.andersson,
	mukesh.savaliya, jyothi.seerapu

On 3/13/26 5:19 PM, Praveen Talari wrote:
> The current interrupt handler only checks the GENI main IRQ status
> (m_irq) before deciding to return IRQ_NONE. This can lead to spurious
> IRQ_NONE returns when DMA interrupts are pending but m_irq is zero.
> 
> Move the DMA TX/RX status register reads to the beginning of the ISR,
> right after reading m_irq. Update the early return condition to check
> all three status registers (m_irq, dma_tx_status, dma_rx_status) before
> returning IRQ_NONE.
> 
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR
  2026-03-13 16:19 [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR Praveen Talari
  2026-03-17 16:52 ` Konrad Dybcio
@ 2026-03-17 17:08 ` Mark Brown
  2026-03-17 18:10 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-03-17 17:08 UTC (permalink / raw)
  To: Praveen Talari
  Cc: linux-arm-msm, linux-spi, linux-kernel, bjorn.andersson,
	konrad.dybcio, mukesh.savaliya, jyothi.seerapu

On Fri, 13 Mar 2026 21:49:01 +0530, Praveen Talari wrote:
> spi: geni-qcom: Check DMA interrupts early in ISR

Applied to

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

Thanks!

[1/1] spi: geni-qcom: Check DMA interrupts early in ISR
      https://git.kernel.org/broonie/spi/c/8c89a077ca79

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR
  2026-03-13 16:19 [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR Praveen Talari
  2026-03-17 16:52 ` Konrad Dybcio
  2026-03-17 17:08 ` Mark Brown
@ 2026-03-17 18:10 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-03-17 18:10 UTC (permalink / raw)
  To: Praveen Talari
  Cc: linux-arm-msm, linux-spi, linux-kernel, bjorn.andersson,
	konrad.dybcio, mukesh.savaliya, jyothi.seerapu

On Fri, 13 Mar 2026 21:49:01 +0530, Praveen Talari wrote:
> The current interrupt handler only checks the GENI main IRQ status
> (m_irq) before deciding to return IRQ_NONE. This can lead to spurious
> IRQ_NONE returns when DMA interrupts are pending but m_irq is zero.
> 
> Move the DMA TX/RX status register reads to the beginning of the ISR,
> right after reading m_irq. Update the early return condition to check
> all three status registers (m_irq, dma_tx_status, dma_rx_status) before
> returning IRQ_NONE.
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: geni-qcom: Check DMA interrupts early in ISR
      https://git.kernel.org/broonie/misc/c/8c89a077ca79

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-17 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-13 16:19 [PATCH v1] spi: geni-qcom: Check DMA interrupts early in ISR Praveen Talari
2026-03-17 16:52 ` Konrad Dybcio
2026-03-17 17:08 ` Mark Brown
2026-03-17 18:10 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®