Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3437053rwo; Mon, 24 Jul 2023 10:59:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlGkvTfo9LNsHkxOe5A/e50xjFgwQUPr7qLGZe5PDqVJeGyuDa3ukmZrvz8x3UAWRJzoV5ic X-Received: by 2002:a17:902:b904:b0:1b8:971c:b7b7 with SMTP id bf4-20020a170902b90400b001b8971cb7b7mr10701593plb.56.1690221577890; Mon, 24 Jul 2023 10:59:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690221577; cv=none; d=google.com; s=arc-20160816; b=nBDcc6WKm6zvvzPTrZbeurMVNX0cTb7ZZGKKciL3Maa6HSVcrlnMia91oT7fJWRsNs ISnnZUPq3BTncKdW+HZP0FNq/cp+SKQ36z3opWJJtEokNfAx+slknQX5FKZpFNGGyu8B WB4Nz0BSsryCFMZ/A7HkmWzZiyZI4uGNSer5xEqSnjx5pEtw79CBB4m5UHXRsn+qcO3y X3g+tDMOqNnyC4dIJe5GCytaZywoLPMYyf51Yb9X/ps2U000BuYCg/z705QJGQ7Y0HdP E0T3MOqKFYHkaNDX0BGAruMJwe91+TA3uDPBnOzY+3KHMnW9VvUNRwtG4jUM4lxEhR85 14Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JNyqpVZOWr+CnKFL3YYZ3ZKWec+YRH8hvkhleJy81rQ=; fh=Fl3z9NRVGMrfNf1wnF0KGGzVQPGVTdghVlATW5f9+64=; b=V1ZVf7uwqia160W+arB5QJKvQny8KTl8+uLFkeZ3VLLasfNWaVQRFvUfhmpEVjUmQt TTGAmx1H2bwbASE8mFkaQKUHo1Z3LgOgRfDmdvruODYvjT0QgmMbKnNRGvau1IPwfQB+ Ja4+a12HGqMsB07CUbZniF1LOLbqRrR4PBu1KAl8XcLJIcS3UF2Sa6HgjV9niQrL9jXe Of37K/e2o53WL4fG3fVJJV5/um+VKzwmppk84kmhgm80iHpfAX++4duAorqk3nsnzF3n 4WaAUVar1FGtt+R0Cyarbw8/wDept7P00LUbaXPgUi9yQFb2iRm0WlvDycS0MSK4rSPA grxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IxbANhLt; 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 q12-20020a17090311cc00b001b4fc117bf0si10452463plh.116.2023.07.24.10.59.26; Mon, 24 Jul 2023 10:59:37 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IxbANhLt; 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 S230235AbjGXRM0 (ORCPT + 99 others); Mon, 24 Jul 2023 13:12:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229700AbjGXRMZ (ORCPT ); Mon, 24 Jul 2023 13:12:25 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65C3EA9; Mon, 24 Jul 2023 10:12:24 -0700 (PDT) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 20816975; Mon, 24 Jul 2023 19:11:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1690218684; bh=odFvO1+QwEIPjybdR26Ls0DIThfTq1TVDS1TIUkBGjg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IxbANhLtfZf0v27oPwIhnKyJQqvWjD8DpMSafcvjTIQv1lGz8KMUDnxvW1zqb56ff /Zqrr5501q27hsHOPD6O4vYWVdgMwrC/kSInGnFZAXBr86poGYMZYlHSJwqw6heI3L LRoXrtsZoovhsW21q9WQjVOzcl3E8yKx4lLUBUGk= Date: Mon, 24 Jul 2023 20:12:29 +0300 From: Laurent Pinchart To: Petr Tesarik Cc: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Andy Shevchenko , Arnd Bergmann , Linus Walleij , Jacopo Mondi , Hans Verkuil , Mauro Carvalho Chehab , "open list:SUPERH" , open list , Roberto Sassu , petr@tesarici.cz, Geert Uytterhoeven Subject: Re: [PATCH v1] sh: boards: fix CEU buffer size passed to dma_declare_coherent_memory() Message-ID: <20230724171229.GC11977@pendragon.ideasonboard.com> References: <20230724120742.2187-1-petrtesarik@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230724120742.2187-1-petrtesarik@huaweicloud.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Petr, Thank you for the patch. On Mon, Jul 24, 2023 at 02:07:42PM +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 Reviewed-by: Laurent Pinchart But given that nobody noticed for 5 years, maybe we should drop renesas-ceu support from those boards ? Or drop the boards completely ? > --- > 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, -- Regards, Laurent Pinchart