AM335X: CPSW fix for recursive locking
authorChandan Nath <chandan.nath@ti.com>
Thu, 22 Sep 2011 05:51:52 +0000 (11:21 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:13:57 +0000 (00:43 +0530)
This patch is added to remove recursive locking seen in
cpsw deinitializing function. spin_lock_irqsave() is called
recursively with same resource in both cpdma_chan_stop and
__cpdma_chan_process functions which leads to recursive locking
and so multiple locking is removed.

Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
drivers/net/ethernet/ti/davinci_cpdma.c

index c97d2f59085504274eddcc2d5a25ecf352c824f0..ae1b5e3af22d661b8807d71a03944709da056c56 100644 (file)
@@ -720,9 +720,6 @@ static int __cpdma_chan_process(struct cpdma_chan *chan)
        int                             status, outlen;
        struct cpdma_desc_pool          *pool = ctlr->pool;
        dma_addr_t                      desc_dma;
-       unsigned long                   flags;
-
-       spin_lock_irqsave(&chan->lock, flags);
 
        desc = chan->head;
        if (!desc) {
@@ -751,13 +748,10 @@ static int __cpdma_chan_process(struct cpdma_chan *chan)
                chan_write(chan, hdp, desc_phys(pool, chan->head));
        }
 
-       spin_unlock_irqrestore(&chan->lock, flags);
-
        __cpdma_chan_free(chan, desc, outlen, status);
        return status;
 
 unlock_ret:
-       spin_unlock_irqrestore(&chan->lock, flags);
        return status;
 }