Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754227Ab1DRKvL (ORCPT ); Mon, 18 Apr 2011 06:51:11 -0400 Received: from eu1sys200aog114.obsmtp.com ([207.126.144.137]:43055 "EHLO eu1sys200aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752288Ab1DRKuq (ORCPT ); Mon, 18 Apr 2011 06:50:46 -0400 From: Viresh Kumar To: , , Cc: , , , , , , , Viresh Kumar Subject: [PATCH 3/6] dmaengine/dw_dmac: call dwc_descriptor_complete from dwc_control with lock held Date: Mon, 18 Apr 2011 16:20:01 +0530 Message-ID: <66b3083da689c5e76d7322ca9f117d631fda08af.1303123511.git.viresh.kumar@st.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 36 dwc_descriptor_complete must always be called with channel lock held. This patch moves unlock code, in dwc_control(), untill after dwc_descriptor_complete is called. Signed-off-by: Viresh Kumar --- drivers/dma/dw_dmac.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 69a9c9d..b49d7f3 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -830,12 +830,12 @@ static int dwc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, list_splice_init(&dwc->queue, &list); list_splice_init(&dwc->active_list, &list); - spin_unlock_irqrestore(&dwc->lock, dw->flags); - /* Flush all pending and queued descriptors */ list_for_each_entry_safe(desc, _desc, &list, desc_node) dwc_descriptor_complete(dwc, desc); + spin_unlock_irqrestore(&dwc->lock, dw->flags); + return 0; } -- 1.7.2.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/