RE: [PATCH 3.11-stable] dmaengine: imx-dma: fix callback path in tasklet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch is already approved by "Vinod Koul <vinod.koul@xxxxxxxxx>"

Thanks.

Best Regards.

> -----Original Message-----
> From: stable-owner@xxxxxxxxxxxxxxx [mailto:stable-owner@xxxxxxxxxxxxxxx]
> On Behalf Of Jonghwan Choi
> Sent: Thursday, October 10, 2013 2:16 PM
> To: 'Jonghwan Choi'
> Cc: stable@xxxxxxxxxxxxxxx; 'Michael Grzeschik'; 'Vinod Koul';
> cpgs@xxxxxxxxxxx
> Subject: [PATCH 3.11-stable] dmaengine: imx-dma: fix callback path in
> tasklet
> 
> This patch looks like it should be in the 3.11-stable tree, should we
> apply
> it?
> 
> ------------------
> 
> From: "Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>"
> 
> commit fcaaba6c7136fe47e5a13352f99a64b019b6d2c5 upstream
> 
> We need to free the ld_active list head before jumping into the callback
> routine. Otherwise the callback could run into issue_pending and change
> our ld_active list head we just going to free. This will run the channel
> list into an currupted and undefined state.
> 
>  Cc: <stable@xxxxxxxxxxxxxxx> # 3.11.x: 5a276fa: dmaengine: imx-dma: fix
> lockdep
>  Cc: <stable@xxxxxxxxxxxxxxx> # 3.11.x: edc530f: dmaengine: imx-dma: fix
> slow path
> Signed-off-by: Michael Grzeschik <m.grzeschik@xxxxxxxxxxxxxx>
> Signed-off-by: Vinod Koul <vinod.koul@xxxxxxxxx>
> Signed-off-by: Jonghwan Choi <jhbird.choi@xxxxxxxxxxx>
> ---
>  drivers/dma/imx-dma.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
> index b8440dd..25787d06 100644
> --- a/drivers/dma/imx-dma.c
> +++ b/drivers/dma/imx-dma.c
> @@ -627,13 +627,11 @@ static void imxdma_tasklet(unsigned long data)
> 
>  	if (list_empty(&imxdmac->ld_active)) {
>  		/* Someone might have called terminate all */
> -		goto out;
> +		spin_unlock_irqrestore(&imxdma->lock, flags);
> +		return;
>  	}
>  	desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc,
> node);
> 
> -	if (desc->desc.callback)
> -		desc->desc.callback(desc->desc.callback_param);
> -
>  	/* If we are dealing with a cyclic descriptor, keep it on ld_active
>  	 * and dont mark the descriptor as complete.
>  	 * Only in non-cyclic cases it would be marked as complete
> @@ -661,6 +659,10 @@ static void imxdma_tasklet(unsigned long data)
>  	}
>  out:
>  	spin_unlock_irqrestore(&imxdma->lock, flags);
> +
> +	if (desc->desc.callback)
> +		desc->desc.callback(desc->desc.callback_param);
> +
>  }
> 
>  static int imxdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
> --
> 1.7.9.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]