linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dmaengine: coh901318: Fix a double lock bug in dma_tc_handle()
@ 2020-02-17 14:40 Dan Carpenter
  2020-02-17 22:24 ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2020-02-17 14:40 UTC (permalink / raw)
  To: Linus Walleij
  Cc: kernel-janitors, Vinod Koul, Jia-Ju Bai, dmaengine, Dan Williams,
	linux-arm-kernel

The caller is already holding the lock so this will deadlock.

Fixes: 0b58828c923e ("DMAENGINE: COH 901 318 remove irq counting")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is the second double lock bug found using static analysis.  The
previous one was commit 627469e4445b ("dmaengine: coh901318: Fix a
double-lock bug").

The fact that this has been broken for ten years suggests that no one
has the hardware.

 drivers/dma/coh901318.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index e51d836afcc7..1092d4ce723e 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -1947,8 +1947,6 @@ static void dma_tc_handle(struct coh901318_chan *cohc)
 		return;
 	}
 
-	spin_lock(&cohc->lock);
-
 	/*
 	 * When we reach this point, at least one queue item
 	 * should have been moved over from cohc->queue to
@@ -1969,8 +1967,6 @@ static void dma_tc_handle(struct coh901318_chan *cohc)
 	if (coh901318_queue_start(cohc) == NULL)
 		cohc->busy = 0;
 
-	spin_unlock(&cohc->lock);
-
 	/*
 	 * This tasklet will remove items from cohc->active
 	 * and thus terminates them.
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-02-24 16:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-17 14:40 [PATCH] dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() Dan Carpenter
2020-02-17 22:24 ` Geert Uytterhoeven
2020-02-19  9:17   ` Vinod Koul
2020-02-19  9:20     ` Geert Uytterhoeven
2020-02-19  9:27       ` Vinod Koul
2020-02-21 14:50     ` Linus Walleij
2020-02-24 16:30       ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).