[PATCH 1/6] dmaengine/dw_dmac: Replace spin_lock_bh with irqsave variants

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Apr 26 16:30:44 EDT 2011


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.



More information about the linux-arm-kernel mailing list