Skip to content

Commit ba2bfc3

Browse files
Petr Tesarikroxanan1996
authored andcommitted
sh: boards: Fix CEU buffer size passed to dma_declare_coherent_memory()
BugLink: https://bugs.launchpad.net/bugs/2041702 [ Upstream commit fb60211 ] 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: 39fb993 ("media: arch: sh: ap325rxa: Use new renesas-ceu camera driver") Fixes: c2f9b05 ("media: arch: sh: ecovec: Use new renesas-ceu camera driver") Fixes: f3590dc ("media: arch: sh: kfr2r09: Use new renesas-ceu camera driver") Fixes: 186c446 ("media: arch: sh: migor: Use new renesas-ceu camera driver") Fixes: 1a3c230 ("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> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 0f89f02 commit ba2bfc3

File tree

5 files changed

+7
-11
lines changed

5 files changed

+7
-11
lines changed

arch/sh/boards/mach-ap325rxa/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static int __init ap325rxa_devices_setup(void)
530530
device_initialize(&ap325rxa_ceu_device.dev);
531531
dma_declare_coherent_memory(&ap325rxa_ceu_device.dev,
532532
ceu_dma_membase, ceu_dma_membase,
533-
ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
533+
CEU_BUFFER_MEMORY_SIZE);
534534

535535
platform_device_add(&ap325rxa_ceu_device);
536536

arch/sh/boards/mach-ecovec24/setup.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,15 +1454,13 @@ static int __init arch_setup(void)
14541454
device_initialize(&ecovec_ceu_devices[0]->dev);
14551455
dma_declare_coherent_memory(&ecovec_ceu_devices[0]->dev,
14561456
ceu0_dma_membase, ceu0_dma_membase,
1457-
ceu0_dma_membase +
1458-
CEU_BUFFER_MEMORY_SIZE - 1);
1457+
CEU_BUFFER_MEMORY_SIZE);
14591458
platform_device_add(ecovec_ceu_devices[0]);
14601459

14611460
device_initialize(&ecovec_ceu_devices[1]->dev);
14621461
dma_declare_coherent_memory(&ecovec_ceu_devices[1]->dev,
14631462
ceu1_dma_membase, ceu1_dma_membase,
1464-
ceu1_dma_membase +
1465-
CEU_BUFFER_MEMORY_SIZE - 1);
1463+
CEU_BUFFER_MEMORY_SIZE);
14661464
platform_device_add(ecovec_ceu_devices[1]);
14671465

14681466
gpiod_add_lookup_table(&cn12_power_gpiod_table);

arch/sh/boards/mach-kfr2r09/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static int __init kfr2r09_devices_setup(void)
603603
device_initialize(&kfr2r09_ceu_device.dev);
604604
dma_declare_coherent_memory(&kfr2r09_ceu_device.dev,
605605
ceu_dma_membase, ceu_dma_membase,
606-
ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
606+
CEU_BUFFER_MEMORY_SIZE);
607607

608608
platform_device_add(&kfr2r09_ceu_device);
609609

arch/sh/boards/mach-migor/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static int __init migor_devices_setup(void)
604604
device_initialize(&migor_ceu_device.dev);
605605
dma_declare_coherent_memory(&migor_ceu_device.dev,
606606
ceu_dma_membase, ceu_dma_membase,
607-
ceu_dma_membase + CEU_BUFFER_MEMORY_SIZE - 1);
607+
CEU_BUFFER_MEMORY_SIZE);
608608

609609
platform_device_add(&migor_ceu_device);
610610

arch/sh/boards/mach-se/7724/setup.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -940,15 +940,13 @@ static int __init devices_setup(void)
940940
device_initialize(&ms7724se_ceu_devices[0]->dev);
941941
dma_declare_coherent_memory(&ms7724se_ceu_devices[0]->dev,
942942
ceu0_dma_membase, ceu0_dma_membase,
943-
ceu0_dma_membase +
944-
CEU_BUFFER_MEMORY_SIZE - 1);
943+
CEU_BUFFER_MEMORY_SIZE);
945944
platform_device_add(ms7724se_ceu_devices[0]);
946945

947946
device_initialize(&ms7724se_ceu_devices[1]->dev);
948947
dma_declare_coherent_memory(&ms7724se_ceu_devices[1]->dev,
949948
ceu1_dma_membase, ceu1_dma_membase,
950-
ceu1_dma_membase +
951-
CEU_BUFFER_MEMORY_SIZE - 1);
949+
CEU_BUFFER_MEMORY_SIZE);
952950
platform_device_add(ms7724se_ceu_devices[1]);
953951

954952
return platform_add_devices(ms7724se_devices,

0 commit comments

Comments
 (0)