[PATCH] ata: pata_pxa: fix the inverted DMA completion timeout check
From: shao.mingyin
Date: Sat Oct 31 2026 - 10:21:50 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
pxa_bmdma_stop() waits for the DMA completion that pxa_ata_dma_irq()
signals and reports a timeout when the wait fails. The condition is
inverted: wait_for_completion_timeout() returns zero on timeout, but the
driver prints "Timeout waiting for DMA completion!" when the return value
is non-zero, that is when the DMA actually completed. A real timeout is
silent.
Negate the wait so that the error is reported only when the completion
does not arrive. The condition has been inverted since the driver was
added, the dmaengine conversion kept it.
Fixes: 2dc6c6f15da9 ("[ARM] pata_pxa: DMA-capable PATA driver")
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
index a694f6a178e3..f041e6adc9d1 100644
--- a/drivers/ata/pata_pxa.c
+++ b/drivers/ata/pata_pxa.c
@@ -95,9 +95,9 @@ static void pxa_bmdma_stop(struct ata_queued_cmd *qc)
enum dma_status status;
status = dmaengine_tx_status(pd->dma_chan, pd->dma_cookie, NULL);
if (status != DMA_ERROR && status != DMA_COMPLETE &&
- wait_for_completion_timeout(&pd->dma_done, HZ))
+ !wait_for_completion_timeout(&pd->dma_done, HZ))
ata_dev_err(qc->dev, "Timeout waiting for DMA completion!");
dmaengine_terminate_all(pd->dma_chan);
}