Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp530371rdb; Fri, 8 Sep 2023 08:08:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFqB6x46k1daS13WIvjoBrQv5qLXpTSWr8fbd47u1FdAzhJRnqQZs2oEUdX9sBV6oEEwSTk X-Received: by 2002:a17:903:22c5:b0:1bf:703d:cc6b with SMTP id y5-20020a17090322c500b001bf703dcc6bmr3052925plg.10.1694185698598; Fri, 08 Sep 2023 08:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694185698; cv=none; d=google.com; s=arc-20160816; b=PQa2cwfb8sdyoQ+LZzjm5tkj9tb6NthxYlBKILSfDI9DmUQ2zZsWCETwUzg0xU3vZP 2eHe4i7d4oJc4Yoez5q/I50T0b8cMh4bByjEN/6D/JS9QFvCl3hk1GpVRSQVdCrd9s2C efdQejbN6j7VbYjX6NYG2/NbBv+vHEEKr1I1mHaUit1tz4gU/xRey2K69fQw08KWIQ4E K/F4K5DLazGvh1nX3gNi95KKoVojQNp/Ii9RJgODxptAQ+vggy3BpJrnmczExqjqG7eb iKrOcMQB/rurol4Slvo9RaE5jj3OGygjc5V8Ee74Es4NhQVdmdXoHFQyVmXD6CrbGRHl 9TbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=trru9ASIKV6rq9Kx2ka/v2Q4cXbY8TAqgmT51717mYU=; fh=SKrgC6xnx5erXhTi3WeUND1XtDaar9oRCEYhqtchduo=; b=WU/+jDf/5cLeQ2dOhS3/45AVTI8EnS58SRLDq3Nct2f94iB/8knE4UjNxJNtguNyk0 4ozWiKHAKghCm8AHF6esTqDIcGnoTULyd7lNQRN0bHhcgqPBhK1CabDo9OFEhB7ZhXa7 bdBIVX9lqLWGinEafmUzfNt/hqBhoNsyA9xg+98Q88iv0xFFhZ2Qa9oEYYmqD71Bzcq6 aPiuDrHl8iV6DkAdRv4IOZC4y0lUwcH0ZuffMwO6DaoB8fZbnYHfuiL5e73FoGN7kftR szVUa2lMqCqyXhex/1jq0GR/eOWx9nksU/1UYT/yz9q5YKBIk7ejNp7VhdnryyXHSaUU QNCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t15-20020a1709027fcf00b001bc8af2bc6bsi1755329plb.170.2023.09.08.08.08.01; Fri, 08 Sep 2023 08:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240731AbjIHJgf convert rfc822-to-8bit (ORCPT + 99 others); Fri, 8 Sep 2023 05:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbjIHJge (ORCPT ); Fri, 8 Sep 2023 05:36:34 -0400 Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AE5111B; Fri, 8 Sep 2023 02:36:30 -0700 (PDT) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.95) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qeXuE-000ROj-Ku; Fri, 08 Sep 2023 11:36:02 +0200 Received: from p5b13a40a.dip0.t-ipconnect.de ([91.19.164.10] helo=[192.168.178.81]) by inpost2.zedat.fu-berlin.de (Exim 4.95) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qeXuE-001TFN-E4; Fri, 08 Sep 2023 11:36:02 +0200 Message-ID: Subject: Re: [PATCH v1] sh: boards: fix CEU buffer size passed to dma_declare_coherent_memory() From: John Paul Adrian Glaubitz To: Petr Tesarik , Yoshinori Sato , Rich Felker , Andy Shevchenko , Arnd Bergmann , Linus Walleij , Jacopo Mondi , Hans Verkuil , Mauro Carvalho Chehab , Laurent Pinchart , "open list:SUPERH" , open list Cc: Roberto Sassu , petr@tesarici.cz Date: Fri, 08 Sep 2023 11:36:01 +0200 In-Reply-To: <20230724120742.2187-1-petrtesarik@huaweicloud.com> References: <20230724120742.2187-1-petrtesarik@huaweicloud.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 91.19.164.10 X-ZEDAT-Hint: PO X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2023-07-24 at 14:07 +0200, Petr Tesarik wrote: > From: Petr Tesarik > > 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 > --- > 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, Reviewed-by: John Paul Adrian Glaubitz -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913