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:   Mon, 24 Jul 2023 15:22:50 +0200
From:   Jacopo Mondi <jacopo.mondi@...asonboard.com>
To:     Petr Tesarik <petrtesarik@...weicloud.com>
Cc:     Yoshinori Sato <ysato@...rs.sourceforge.jp>,
        Rich Felker <dalias@...c.org>,
        John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Arnd Bergmann <arnd@...db.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Jacopo Mondi <jacopo+renesas@...ndi.org>,
        Hans Verkuil <hans.verkuil@...co.com>,
        Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        "open list:SUPERH" <linux-sh@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>,
        Roberto Sassu <roberto.sassu@...weicloud.com>, petr@...arici.cz
Subject: Re: [PATCH v1] sh: boards: fix CEU buffer size passed to
 dma_declare_coherent_memory()

Hi Petr,

On Mon, Jul 24, 2023 at 02:07:42PM +0200, Petr Tesarik wrote:
> From: Petr Tesarik <petr.tesarik.ext@...wei.com>
>
> In all these cases, the last argument to dma_declare_coherent_memory() is
> the buffer end address, but the expected value should be the size of the
> reserved region.
>
> Fixes: 39fb993038e1 ("media: arch: sh: ap325rxa: Use new renesas-ceu camera driver")
> Fixes: c2f9b05fd5c1 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver")
> Fixes: f3590dc32974 ("media: arch: sh: kfr2r09: Use new renesas-ceu camera driver")
> Fixes: 186c446f4b84 ("media: arch: sh: migor: Use new renesas-ceu camera driver")
> Fixes: 1a3c230b4151 ("media: arch: sh: ms7724se: Use new renesas-ceu camera driver")

Ups, seems like I have introduced all of these! thanks for fixing
Reviewed-by: Jacopo Mondi <jacopo.mondi@...asonboard.com>

Thanks
  j

> Signed-off-by: Petr Tesarik <petr.tesarik.ext@...wei.com>
> ---
>  arch/sh/boards/mach-ap325rxa/setup.c | 2 +-
>  arch/sh/boards/mach-ecovec24/setup.c | 6 ++----
>  arch/sh/boards/mach-kfr2r09/setup.c  | 2 +-
>  arch/sh/boards/mach-migor/setup.c    | 2 +-
>  arch/sh/boards/mach-se/7724/setup.c  | 6 ++----
>  5 files changed, 7 insertions(+), 11 deletions(-)
>
> diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
> index 151792162152..645cccf3da88 100644
> --- a/arch/sh/boards/mach-ap325rxa/setup.c
> +++ b/arch/sh/boards/mach-ap325rxa/setup.c
> @@ -531,7 +531,7 @@ static int __init ap325rxa_devices_setup(void)
>  	device_initialize(&ap325rxa_ceu_device.dev);
>  	dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
>  			ceu_dma_membase, ceu_dma_membase,
> -			ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
> +			CEU_BUFFER_MEMORY_SIZE);
>
>  	platform_device_add(&ap325rxa_ceu_device);
>
> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> index 674da7ebd8b7..7ec03d4a4edf 100644
> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -1454,15 +1454,13 @@ static int __init arch_setup(void)
>  	device_initialize(&ecovec_ceu_devices[0]->dev);
>  	dma_declare_coherent_memory(&ecovec_ceu_devices[0]->dev,
>  				    ceu0_dma_membase, ceu0_dma_membase,
> -				    ceu0_dma_membase +
> -				    CEU_BUFFER_MEMORY_SIZE - 1);
> +				    CEU_BUFFER_MEMORY_SIZE);
>  	platform_device_add(ecovec_ceu_devices[0]);
>
>  	device_initialize(&ecovec_ceu_devices[1]->dev);
>  	dma_declare_coherent_memory(&ecovec_ceu_devices[1]->dev,
>  				    ceu1_dma_membase, ceu1_dma_membase,
> -				    ceu1_dma_membase +
> -				    CEU_BUFFER_MEMORY_SIZE - 1);
> +				    CEU_BUFFER_MEMORY_SIZE);
>  	platform_device_add(ecovec_ceu_devices[1]);
>
>  	gpiod_add_lookup_table(&cn12_power_gpiod_table);
> diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
> index 20f4db778ed6..c6d556dfbbbe 100644
> --- a/arch/sh/boards/mach-kfr2r09/setup.c
> +++ b/arch/sh/boards/mach-kfr2r09/setup.c
> @@ -603,7 +603,7 @@ static int __init kfr2r09_devices_setup(void)
>  	device_initialize(&kfr2r09_ceu_device.dev);
>  	dma_declare_coherent_memory(&kfr2r09_ceu_device.dev,
>  			ceu_dma_membase, ceu_dma_membase,
> -			ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
> +			CEU_BUFFER_MEMORY_SIZE);
>
>  	platform_device_add(&kfr2r09_ceu_device);
>
> diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
> index f60061283c48..773ee767d0c4 100644
> --- a/arch/sh/boards/mach-migor/setup.c
> +++ b/arch/sh/boards/mach-migor/setup.c
> @@ -604,7 +604,7 @@ static int __init migor_devices_setup(void)
>  	device_initialize(&migor_ceu_device.dev);
>  	dma_declare_coherent_memory(&migor_ceu_device.dev,
>  			ceu_dma_membase, ceu_dma_membase,
> -			ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
> +			CEU_BUFFER_MEMORY_SIZE);
>
>  	platform_device_add(&migor_ceu_device);
>
> diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
> index b60a2626e18b..6495f9354065 100644
> --- a/arch/sh/boards/mach-se/7724/setup.c
> +++ b/arch/sh/boards/mach-se/7724/setup.c
> @@ -940,15 +940,13 @@ static int __init devices_setup(void)
>  	device_initialize(&ms7724se_ceu_devices[0]->dev);
>  	dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev,
>  				    ceu0_dma_membase, ceu0_dma_membase,
> -				    ceu0_dma_membase +
> -				    CEU_BUFFER_MEMORY_SIZE - 1);
> +				    CEU_BUFFER_MEMORY_SIZE);
>  	platform_device_add(ms7724se_ceu_devices[0]);
>
>  	device_initialize(&ms7724se_ceu_devices[1]->dev);
>  	dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev,
>  				    ceu1_dma_membase, ceu1_dma_membase,
> -				    ceu1_dma_membase +
> -				    CEU_BUFFER_MEMORY_SIZE - 1);
> +				    CEU_BUFFER_MEMORY_SIZE);
>  	platform_device_add(ms7724se_ceu_devices[1]);
>
>  	return platform_add_devices(ms7724se_devices,
> --
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ