sh: boards: Fix CEU buffer size passed to dma_declare_coherent_memory()
authorPetr Tesarik <petr.tesarik.ext@huawei.com>
Mon, 24 Jul 2023 12:07:42 +0000 (14:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:04 +0000 (12:28 +0200)
[ Upstream commit fb60211f377b69acffead3147578f86d0092a7a5 ]

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")
Signed-off-by: Petr Tesarik <petr.tesarik.ext@huawei.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://lore.kernel.org/r/20230724120742.2187-1-petrtesarik@huaweicloud.com
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/sh/boards/mach-ap325rxa/setup.c
arch/sh/boards/mach-ecovec24/setup.c
arch/sh/boards/mach-kfr2r09/setup.c
arch/sh/boards/mach-migor/setup.c
arch/sh/boards/mach-se/7724/setup.c

index c77b5f00a66a3dce3a8e703d4b79bb198fb5f83c..d8f8dca4d7968ef1819953c0e34f9d89e094f0b6 100644 (file)
@@ -530,7 +530,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);
 
index 674da7ebd8b7f5005325c1fe48bb5c0daba2b5a1..7ec03d4a4edf0f0f2f90443a703c96a5dabfb4ee 100644 (file)
@@ -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);
index 20f4db778ed6aee279fb3fc79668aa7076fa5db8..c6d556dfbbbe6850017b4374098ff4d4a8dabb7f 100644 (file)
@@ -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);
 
index f60061283c4827440c18c97d14a39d925e99a876..773ee767d0c4e0299484c6b4910b0d40d8b7d2e9 100644 (file)
@@ -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);
 
index b60a2626e18b274f7965c3623b9cb96e34f7152b..6495f9354065435628f4f8af8994c3436a7e17f8 100644 (file)
@@ -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,