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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 16 Mar 2018 13:46:40 -0500
From:   Dan Rue <dan.rue@...aro.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Peter Ujfalusi <peter.ujfalusi@...com>,
        Eric Anholt <eric@...olt.net>,
        Vinod Koul <vinod.koul@...el.com>,
        Sasha Levin <alexander.levin@...rosoft.com>
Subject: Re: [PATCH 4.14 064/109] dmaengine: bcm2835-dma: Use
 vchan_terminate_vdesc() instead of desc_free

On Fri, Mar 16, 2018 at 04:23:33PM +0100, Greg Kroah-Hartman wrote:
> 4.14-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Peter Ujfalusi <peter.ujfalusi@...com>
> 
> 
> [ Upstream commit de92436ac40ffe9933230aa503e24dbb5ede9201 ]
> 
> To avoid race with vchan_complete, use the race free way to terminate
> running transfer.
> 
> Implement the device_synchronize callback to make sure that the terminated
> descriptor is freed.
> 
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
> Acked-by: Eric Anholt <eric@...olt.net>
> Signed-off-by: Vinod Koul <vinod.koul@...el.com>
> Signed-off-by: Sasha Levin <alexander.levin@...rosoft.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>

This patch is causing a build error on arm and arm64 per i.e.
https://kernelci.org/build/id/5aac017e59b5141cb1b3a4d5/

Builds are also failing for arm/arm64 on 4.15 and this patch seems to be a
problem there as well, but I have not verified it yet.

#
# make -j10 -k -s ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=build-arm64 defconfig
#
#
# make -j10 -k -s ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=build-arm64
#
arch/arm64/Makefile:48: Detected assembler with broken .inst; disassembly will be unreliable
../drivers/dma/bcm2835-dma.c: In function 'bcm2835_dma_terminate_all':
../drivers/dma/bcm2835-dma.c:815:3: error: implicit declaration of function 'vchan_terminate_vdesc' [-Werror=implicit-function-declaration]
   vchan_terminate_vdesc(&c->desc->vd);
   ^
cc1: some warnings being treated as errors
../scripts/Makefile.build:334: recipe for target 'drivers/dma/bcm2835-dma.o' failed
make[3]: *** [drivers/dma/bcm2835-dma.o] Error 1
make[3]: Target '__build' not remade because of errors.
../scripts/Makefile.build:587: recipe for target 'drivers/dma' failed
make[2]: *** [drivers/dma] Error 2
make[2]: Target '__build' not remade because of errors.
/home/buildslave/workspace/kernel-single-defconfig-builder/defconfig/defconfig/label/builder/Makefile:1031: recipe for target 'drivers' failed
make[1]: *** [drivers] Error 2
make[1]: Target '_all' not remade because of errors.
Makefile:146: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Target '_all' not remade because of errors.

> ---
>  drivers/dma/bcm2835-dma.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -812,7 +812,7 @@ static int bcm2835_dma_terminate_all(str
>  	 * c->desc is NULL and exit.)
>  	 */
>  	if (c->desc) {
> -		bcm2835_dma_desc_free(&c->desc->vd);
> +		vchan_terminate_vdesc(&c->desc->vd);
>  		c->desc = NULL;
>  		bcm2835_dma_abort(c->chan_base);
>  
> @@ -836,6 +836,13 @@ static int bcm2835_dma_terminate_all(str
>  	return 0;
>  }
>  
> +static void bcm2835_dma_synchronize(struct dma_chan *chan)
> +{
> +	struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> +
> +	vchan_synchronize(&c->vc);
> +}
> +
>  static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id,
>  				 int irq, unsigned int irq_flags)
>  {
> @@ -942,6 +949,7 @@ static int bcm2835_dma_probe(struct plat
>  	od->ddev.device_prep_dma_memcpy = bcm2835_dma_prep_dma_memcpy;
>  	od->ddev.device_config = bcm2835_dma_slave_config;
>  	od->ddev.device_terminate_all = bcm2835_dma_terminate_all;
> +	od->ddev.device_synchronize = bcm2835_dma_synchronize;
>  	od->ddev.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
>  	od->ddev.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
>  	od->ddev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV) |
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ