diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-01-27 16:52:13 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-16 07:03:32 +0300 |
commit | f39150720edcc9e6f5d61fd1ed6044eab1e5fa0d (patch) | |
tree | 80c9bbd425b3daea48e07dd882651bf84685eb65 /drivers | |
parent | b7a4fd53d2f2fe1630ef857429408e6b17031724 (diff) | |
download | linux-f39150720edcc9e6f5d61fd1ed6044eab1e5fa0d.tar.xz |
dmaengine: rcar-dmac: Fix spinlock issues in interrupt
The rcar_dmac_desc_put() function is called in interrupt context and
must thus use spin_lock_irqsave() instead of spin_lock_irq().
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/sh/rcar-dmac.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 8367578bac63..5a6b85527107 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -487,16 +487,16 @@ static int rcar_dmac_desc_alloc(struct rcar_dmac_chan *chan, gfp_t gfp) * * The descriptor must have been removed from the channel's lists before calling * this function. - * - * Locking: Must be called in non-atomic context. */ static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan, struct rcar_dmac_desc *desc) { - spin_lock_irq(&chan->lock); + unsigned long flags; + + spin_lock_irqsave(&chan->lock, flags); list_splice_tail_init(&desc->chunks, &chan->desc.chunks_free); list_add_tail(&desc->node, &chan->desc.free); - spin_unlock_irq(&chan->lock); + spin_unlock_irqrestore(&chan->lock, flags); } static void rcar_dmac_desc_recycle_acked(struct rcar_dmac_chan *chan) |