From cc6684b8f4efe847ee71a55845aadaaf80813d54 Mon Sep 17 00:00:00 2001 From: Fancy Fang Date: Tue, 22 Mar 2016 10:52:27 +0800 Subject: [PATCH] MLK-12420 fix potential head list corruption. The head list may be corrupted when two requests from the same 'pxp_chan' are issued sequentially. So change the issue_pending function to strictly serialized the requests to avoid this kind of issue. Signed-off-by: Fancy Fang --- drivers/dma/pxp/pxp_dma_v3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/dma/pxp/pxp_dma_v3.c b/drivers/dma/pxp/pxp_dma_v3.c index f44045084958..4857c20dd443 100644 --- a/drivers/dma/pxp/pxp_dma_v3.c +++ b/drivers/dma/pxp/pxp_dma_v3.c @@ -1809,6 +1809,8 @@ static void pxp_issue_pending(struct dma_chan *chan) struct pxps *pxp = to_pxp(pxp_dma); unsigned long flags0, flags; + down(&pxp->sema); + spin_lock_irqsave(&pxp->lock, flags0); spin_lock_irqsave(&pxp_chan->lock, flags); @@ -1825,7 +1827,6 @@ static void pxp_issue_pending(struct dma_chan *chan) spin_unlock_irqrestore(&pxp->lock, flags0); pxp_clk_enable(pxp); - down(&pxp->sema); spin_lock_irqsave(&pxp->lock, flags); pxp->pxp_ongoing = 1; -- 2.17.1