Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1993613lfo; Sat, 28 May 2022 13:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyddOw4p+kbrk0Tul3MWTrSyRe+b4ig7svBEb2f6M6CWEnHrVgOUvbcpPdLIcurYGISkNel X-Received: by 2002:a17:902:7c11:b0:162:1122:8a7f with SMTP id x17-20020a1709027c1100b0016211228a7fmr35082160pll.37.1653768149782; Sat, 28 May 2022 13:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653768149; cv=none; d=google.com; s=arc-20160816; b=AR1anc+BDXw1S8Dd1y2J6kOWsj14gKeW5owHZsvSZPrv5bIOlkazaSjV9FfZXRH58N Z1N603OLhutKt4yx+XEEYAirmalvsqABi/sKg9td3+wKLP2uN7VF84DEW5irZTzRyBSD K7ZsMf/GAwxjHtWywsVBP8EYD0m+Cwuo9DYoovwaUhnfiO670veFYm1xuLzp65b/yHx8 GMHt9DVMZR26lgr2ggZ3eu1nykDyQRhFDK8ncGGoZodLflOutdSCgwc99BKXZ/97x63z Q9uO0PvzvchaAwTJCVm3hRJ3AfM3gq1a4VWZ4UXKNMjyHqyvzjeLa4townNfyp2ggUuQ BD9w== 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=3WnguRZLVfGoSX9zr8213z+cLpZyYlKDXrozeUElf0g=; b=ILWMeQr9NcI5H8Lo2NKA0um2hdtZd5kq3x0VXjpUTBQqhXOSmWGWihvpiCA6/5CZIW 1X3ahyDpef6mzOntDfstGNggLlEHXVAGv3HKcaBSHZvZGuKkwvDe4+0YHjc9h80yNo7I yAmDSGcC8bths3hbMkcpql8xTFAaCaW/rJdf7QYUWT6xG/zItKZNyIEQH8RhI16rJMa4 DnVjS0Nx8O5yeHybmmS46NbAs+c2j60UcWavjL00D/QQCLTNlbpiP+x0yKWQTSN8Kq6d TxiDbdEa587l4GOQp7hEZQ5STC9DEgZ17d/488PIPaLinTIZgWE3L+9q6Qkpstm6mT1e usUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ix1Reun4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b6-20020a170902bd4600b0015ea5cf069esi9265565plx.489.2022.05.28.13.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=ix1Reun4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0EC2549242; Sat, 28 May 2022 12:19:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343913AbiE0Jic (ORCPT + 99 others); Fri, 27 May 2022 05:38:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348413AbiE0Jia (ORCPT ); Fri, 27 May 2022 05:38:30 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B432949C82 for ; Fri, 27 May 2022 02:38:28 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id h11so4721170eda.8 for ; Fri, 27 May 2022 02:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3WnguRZLVfGoSX9zr8213z+cLpZyYlKDXrozeUElf0g=; b=ix1Reun4wWMys+cSnZyVdjcSGZQHsynXRRo+htcqY0nvW5P5nuf8nWQ3i+jzgdgYer eLNMo3m+0s3R4BlXve4U0Q/HbtTILpVtY5RxqYWPQ9wc/ie7ibUHn7Wveea9DBtcd/ZA 05S/Jl1AmlDk+T1DN2LXgG7KBw105KbKOIIt8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3WnguRZLVfGoSX9zr8213z+cLpZyYlKDXrozeUElf0g=; b=OaxpSpSE/NeUepRcycSHptxFJ/xLhFRCnWFJeztvdqNPPQThzDIJid4wEY5rXs3dio 95C29GFjfFwTsCbBis6mhqy7wTawklvRCgKELKfP5GdtKgIJ50hXn1s1ZTJT5JWGNPWz BYBaJDJ0kQ7f8619vG9vgOjoVL4g+5Sg21OzrUZGdw/Nuxate1+PowwWY5Bvbym7IRIS /MWWCeHVxtHH/7OihFLhc9LFLFx6gNTJrPkAvVWDIYjZB8BInoyq7qfp13BRhMUfIOCe 81gNK/C4THCTGZPCG8gycCQyi9Gi0KK4wv1nLIoeO1y2yMySrTC4tbwADndS1uK5Zdc2 55Ew== X-Gm-Message-State: AOAM531To5IMZfkMkn833bAOXRmp9qyTpTxtWo+4EJjhTxWlXUixQEVN HBpHW/la9dd8mhUmTl+QQpiolw== X-Received: by 2002:aa7:c0ca:0:b0:42c:5fac:e526 with SMTP id j10-20020aa7c0ca000000b0042c5face526mr2489643edp.219.1653644307249; Fri, 27 May 2022 02:38:27 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i (net-188-217-53-154.cust.vodafonedsl.it. [188.217.53.154]) by smtp.gmail.com with ESMTPSA id i27-20020a50871b000000b0042ab8c5e99fsm1900671edb.14.2022.05.27.02.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 02:38:26 -0700 (PDT) Date: Fri, 27 May 2022 11:38:24 +0200 From: Tommaso Merciai To: Ming Qian Cc: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] media: imx-jpeg: Leave a blank space before the configuration data Message-ID: <20220527093824.GF11217@tom-ThinkPad-T14s-Gen-2i> References: <20220527075437.16882-1-ming.qian@nxp.com> <20220527075437.16882-3-ming.qian@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220527075437.16882-3-ming.qian@nxp.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Ming, I think have some comments on the code for this would be nice for the future On Fri, May 27, 2022 at 03:54:35PM +0800, Ming Qian wrote: > There is a hardware bug that it will load > the first 128 bytes of configuration data twice, > it will led to some configure error. > so shift the configuration data 128 bytes, > and make the first 128 bytes all zero, > then hardware will load the 128 zero twice, From what I've understood you initialize cfg_stm with zeros then you start to write the configuration from 0x80 (128 bytes), avoiding the hw issue right? > and ignore them as garbage. > then the configuration data can be loaded correctly > > Signed-off-by: Ming Qian > Reviewed-by: Mirela Rabulea > --- > drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c > index 734e1b65fbc7..ad4213e020f3 100644 > --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c > +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c > @@ -519,6 +519,7 @@ static bool mxc_jpeg_alloc_slot_data(struct mxc_jpeg_dev *jpeg, > GFP_ATOMIC); > if (!cfg_stm) > goto err; > + memset(cfg_stm, 0, MXC_JPEG_MAX_CFG_STREAM); > jpeg->slot_data[slot].cfg_stream_vaddr = cfg_stm; > > skip_alloc: > @@ -755,7 +756,7 @@ static unsigned int mxc_jpeg_setup_cfg_stream(void *cfg_stream_vaddr, > u32 fourcc, > u16 w, u16 h) > { > - unsigned int offset = 0; > + unsigned int offset = 0x80; > u8 *cfg = (u8 *)cfg_stream_vaddr; > struct mxc_jpeg_sof *sof; > struct mxc_jpeg_sos *sos; > -- > 2.36.1 > Thanks, Tommaso -- Tommaso Merciai Embedded Linux Engineer tommaso.merciai@amarulasolutions.com __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 info@amarulasolutions.com www.amarulasolutions.com