lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 21 May 2015 11:09:07 -0500
From:	Dinh Nguyen <dinguyen@...nsource.altera.com>
To:	Krzysztof Kozlowski <k.kozlowski@...sung.com>,
	Dan Williams <dan.j.williams@...el.com>,
	Vinod Koul <vinod.koul@...el.com>, <dmaengine@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
CC:	<stable@...r.kernel.org>
Subject: Re: [PATCH] dmaengine: pl330: Fix hang on dmaengine_terminate_all
 on certain boards

Hi Krzysztof,

On 05/20/2015 07:34 PM, Krzysztof Kozlowski wrote:
> The pl330 device could hang infinitely on certain boards when DMA
> channels are terminated.
> 
> It was caused by lack of runtime resume when executing
> pl330_terminate_all() which calls the _stop() function. _stop() accesses
> device register and can loop infinitely while checking for device state.
> 
> The hang was confirmed by Dinh Nguyen on Altera SOCFPGA Cyclone V
> board during boot. It can be also triggered with:
> 
> $ echo 1 > /sys/module/dmatest/parameters/iterations
> $ echo dma1chan0 > /sys/module/dmatest/parameters/channel
> $ echo 1 > /sys/module/dmatest/parameters/run
> $ sleep 1
> $ cat /sys/module/dmatest/parameters/run
> 
> Reported-by: Dinh Nguyen <dinguyen@...nsource.altera.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
> Fixes: ae43b3289186 ("ARM: 8202/1: dmaengine: pl330: Add runtime Power Management support v12")
> Cc: <stable@...r.kernel.org>
> Cc: Dinh Nguyen <dinguyen@...nsource.altera.com>
> ---
>  drivers/dma/pl330.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
> index a7d9d3029b14..340f9e607cd8 100644
> --- a/drivers/dma/pl330.c
> +++ b/drivers/dma/pl330.c
> @@ -2127,6 +2127,7 @@ static int pl330_terminate_all(struct dma_chan *chan)
>  	struct pl330_dmac *pl330 = pch->dmac;
>  	LIST_HEAD(list);
>  
> +	pm_runtime_get_sync(pl330->ddma.dev);
>  	spin_lock_irqsave(&pch->lock, flags);
>  	spin_lock(&pl330->lock);
>  	_stop(pch->thread);
> @@ -2151,6 +2152,8 @@ static int pl330_terminate_all(struct dma_chan *chan)
>  	list_splice_tail_init(&pch->work_list, &pl330->desc_pool);
>  	list_splice_tail_init(&pch->completed_list, &pl330->desc_pool);
>  	spin_unlock_irqrestore(&pch->lock, flags);
> +	pm_runtime_mark_last_busy(pl330->ddma.dev);
> +	pm_runtime_put_autosuspend(pl330->ddma.dev);
>  
>  	return 0;
>  }
> 

This patch indeeds fixes the pl330 DMA issue for the SoCFPGA platform.
The multi_v7_defconfig now completely boots on the platform with this patch.

Feel free to add:

Tested-by: Dinh Nguyen <dinguyen@...nsource.altera.com>

Thanks,
Dinh
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ