Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757962Ab1CCKSa (ORCPT ); Thu, 3 Mar 2011 05:18:30 -0500 Received: from eu1sys200aog105.obsmtp.com ([207.126.144.119]:44294 "EHLO eu1sys200aog105.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757886Ab1CCKS2 (ORCPT ); Thu, 3 Mar 2011 05:18:28 -0500 From: Viresh Kumar To: , Cc: , , , Viresh Kumar , , , , , Subject: [PATCH V2 04/13] dw_dmac: Calling dwc_scan_descriptors from dwc_tx_status() after taking lock Date: Thu, 3 Mar 2011 15:47:17 +0530 Message-ID: <72245f0f6b2b25072a0d4641e66b8699819c683e.1299146382.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: 1116 Lines: 32 Lock must be taken before calling dwc_scan_descriptors, as this may access/modify shared data and queues. dwc_tx_status wasn't taking lock before calling this routine. This patch add code that takes lock before calling dwc_scan_descriptors. Signed-off-by: Viresh Kumar --- drivers/dma/dw_dmac.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 942b50f..2b0d5e9 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -836,7 +836,9 @@ dwc_tx_status(struct dma_chan *chan, ret = dma_async_is_complete(cookie, last_complete, last_used); if (ret != DMA_SUCCESS) { + spin_lock_bh(&dwc->lock); dwc_scan_descriptors(to_dw_dma(chan->device), dwc); + spin_unlock_bh(&dwc->lock); last_complete = dwc->completed; last_used = chan->cookie; -- 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/