[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250731-ti-dma-timeout-v1-2-33321d2b7406@bootlin.com>
Date: Thu, 31 Jul 2025 18:41:30 +0200
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Peter Ujfalusi <peter.ujfalusi@...il.com>,
Vinod Koul <vkoul@...nel.org>, Grygorii Strashko <grygorii.strashko@...com>
Cc: Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Peter Ujfalusi <peter.ujfalusi@...com>, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org, Miquel Raynal <miquel.raynal@...tlin.com>,
stable@...r.kernel.org
Subject: [PATCH 2/3] dmaengine: ti: k3-udma: Ensure a minimum polling delay
ktime_to_us() returns 0 if the time (ktime_t stores nanoseconds) is too
small, leading to a while loop without sleeps, kind of conflicting with
the initial aim of this function at observing a small delay and then
guessing the amount of time needed to finish draining the descriptor.
Make sure we always sleep for (abitrarily) at least 1us to reduce
pressure on the CPU, while not waiting too much either.
Fixes: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA")
Cc: stable@...r.kernel.org # 5.7
Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>
---
drivers/dma/ti/k3-udma.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
index b2059baed1b2ffc81c10feca797c763e2a04a357..11232b306475edd5e1ed75d938bbf49ed9c2aabd 100644
--- a/drivers/dma/ti/k3-udma.c
+++ b/drivers/dma/ti/k3-udma.c
@@ -1125,6 +1125,8 @@ static void udma_check_tx_completion(struct work_struct *work)
if (residue_diff) {
delay = (time_diff / residue_diff) *
uc->tx_drain.residue;
+ if (delay < 1000)
+ delay = 1000;
} else {
delay = 100000;
}
--
2.50.1
Powered by blists - more mailing lists