提交 f3915072 编写于 作者: L Laurent Pinchart 提交者: Vinod Koul

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: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: NGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 b7a4fd53
...@@ -487,16 +487,16 @@ static int rcar_dmac_desc_alloc(struct rcar_dmac_chan *chan, gfp_t gfp) ...@@ -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 * The descriptor must have been removed from the channel's lists before calling
* this function. * this function.
*
* Locking: Must be called in non-atomic context.
*/ */
static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan, static void rcar_dmac_desc_put(struct rcar_dmac_chan *chan,
struct rcar_dmac_desc *desc) 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_splice_tail_init(&desc->chunks, &chan->desc.chunks_free);
list_add_tail(&desc->node, &chan->desc.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) static void rcar_dmac_desc_recycle_acked(struct rcar_dmac_chan *chan)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册