Re: [PATCH 1/6] dmaengine/dw_dmac: Replace spin_lock_bh withirqsave variants

From: Russell King - ARM Linux
Date: Tue Apr 26 2011 - 16:31:04 EST


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/