diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-01-27 08:52:13 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-02-15 23:03:32 -0500 |
commit | f39150720edcc9e6f5d61fd1ed6044eab1e5fa0d (patch) | |
tree | 80c9bbd425b3daea48e07dd882651bf84685eb65 | |
parent | b7a4fd53d2f2fe1630ef857429408e6b17031724 (diff) |
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>
-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) | |||
487 | * | 487 | * |
488 | * The descriptor must have been removed from the channel's lists before calling | 488 | * The descriptor must have been removed from the channel's lists before calling |
489 | * this function. | 489 | * this function. |
490 | * | ||
491 | * Locking: Must be called in non-atomic context. | ||
492 | */ | 490 | */ |
493 | static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan, | 491 | static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan, |
494 | struct rcar_dmac_desc *desc) | 492 | struct rcar_dmac_desc *desc) |
495 | { | 493 | { |
496 | spin_lock_irq(&chan->lock); | 494 | unsigned long flags; |
495 | |||
496 | spin_lock_irqsave(&chan->lock, flags); | ||
497 | list_splice_tail_init(&desc->chunks, &chan->desc.chunks_free); | 497 | list_splice_tail_init(&desc->chunks, &chan->desc.chunks_free); |
498 | list_add_tail(&desc->node, &chan->desc.free); | 498 | list_add_tail(&desc->node, &chan->desc.free); |
499 | spin_unlock_irq(&chan->lock); | 499 | spin_unlock_irqrestore(&chan->lock, flags); |
500 | } | 500 | } |
501 | 501 | ||
502 | static void rcar_dmac_desc_recycle_acked(struct rcar_dmac_chan *chan) | 502 | static void rcar_dmac_desc_recycle_acked(struct rcar_dmac_chan *chan) |