dmaengine: coh901318: Fix a double lock bug in dma_tc_handle()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 17 Feb 2020 14:40:50 +0000 (17:40 +0300)
committerVinod Koul <vkoul@kernel.org>
Mon, 24 Feb 2020 16:29:45 +0000 (21:59 +0530)
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>
Link: https://lore.kernel.org/r/20200217144050.3i4ymbytogod4ijn@kili.mountain
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/coh901318.c

index e51d836afcc7765d37ad5b084404aeebd13a8d69..1092d4ce723e436e7f3971bafcbeb084e505b12f 100644 (file)
@@ -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.