Skip to content

Commit 8c89a07

Browse files
ptalari27broonie
authored andcommitted
spi: geni-qcom: Check DMA interrupts early in ISR
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 <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Link: https://patch.msgid.link/20260313-spi-geni-qcom-fix-dma-irq-handling-v1-1-0bd122589e02@oss.qualcomm.com Signed-off-by: Mark Brown <[email protected]>
1 parent dee0774 commit 8c89a07

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

drivers/spi/spi-geni-qcom.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,10 +906,13 @@ static irqreturn_t geni_spi_isr(int irq, void *data)
906906
struct spi_controller *spi = data;
907907
struct spi_geni_master *mas = spi_controller_get_devdata(spi);
908908
struct geni_se *se = &mas->se;
909-
u32 m_irq;
909+
u32 m_irq, dma_tx_status, dma_rx_status;
910910

911911
m_irq = readl(se->base + SE_GENI_M_IRQ_STATUS);
912-
if (!m_irq)
912+
dma_tx_status = readl_relaxed(se->base + SE_DMA_TX_IRQ_STAT);
913+
dma_rx_status = readl_relaxed(se->base + SE_DMA_RX_IRQ_STAT);
914+
915+
if (!m_irq && !dma_tx_status && !dma_rx_status)
913916
return IRQ_NONE;
914917

915918
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)
957960
}
958961
} else if (mas->cur_xfer_mode == GENI_SE_DMA) {
959962
const struct spi_transfer *xfer = mas->cur_xfer;
960-
u32 dma_tx_status = readl_relaxed(se->base + SE_DMA_TX_IRQ_STAT);
961-
u32 dma_rx_status = readl_relaxed(se->base + SE_DMA_RX_IRQ_STAT);
962963

963964
if (dma_tx_status)
964965
writel(dma_tx_status, se->base + SE_DMA_TX_IRQ_CLR);

0 commit comments

Comments
 (0)