[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110426203044.GA17290@n2100.arm.linux.org.uk>
Date: Tue, 26 Apr 2011 21:30:44 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Viresh Kumar <viresh.kumar@...com>
Cc: linux-kernel@...r.kernel.org, vinod.koul@...el.com,
dan.j.williams@...el.com, linux-arm-kernel@...ts.infradead.org,
armando.visconti@...com, shiraz.hashim@...com, amit.goel@...com,
viresh.linux@...il.com, jamie@...ieiles.com
Subject: Re: [PATCH 1/6] dmaengine/dw_dmac: Replace spin_lock_bh with
irqsave variants
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists