Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755404Ab1DZUbB (ORCPT ); Tue, 26 Apr 2011 16:31:01 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:50603 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754387Ab1DZUbA (ORCPT ); Tue, 26 Apr 2011 16:31:00 -0400 Date: Tue, 26 Apr 2011 21:30:44 +0100 From: Russell King - ARM Linux To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, vinod.koul@intel.com, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org, armando.visconti@st.com, shiraz.hashim@st.com, amit.goel@st.com, viresh.linux@gmail.com, jamie@jamieiles.com Subject: Re: [PATCH 1/6] dmaengine/dw_dmac: Replace spin_lock_bh with irqsave variants Message-ID: <20110426203044.GA17290@n2100.arm.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 782 Lines: 21 On Mon, Apr 18, 2011 at 04:19:59PM +0530, Viresh Kumar wrote: > static struct dw_desc *dwc_desc_get(struct dw_dma_chan *dwc) > { > + struct dw_dma *dw = to_dw_dma(dwc->chan.device); > struct dw_desc *desc, *_desc; > struct dw_desc *ret = NULL; > unsigned int i = 0; > > - spin_lock_bh(&dwc->lock); > + spin_lock_irqsave(&dwc->lock, dw->flags); It's a very bad idea to store the IRQ flags like this - it means that another thread operating on this corrupts this threads interrupt flag settings. It should be a local variable. -- 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/