From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9ACAEC433EF for ; Fri, 27 May 2022 10:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L/jwwGgSp6CxlFM1rVB/NcCP10qb+25uDlG72Pm+1Vo=; b=rlj7wNFdT+ka2b 8sPi1feZgyMfawSWirEq8EBDrt/dpYut2xbGhdVoiXt+y7s5+FrMcaOn0K1ZX1pa6Im/dP6XIjL31 Hs600sBliGNlY45qRoN/6RQa1qa66prOqJUfljF+rCG5+2YWl2ZTPOVOhcAVoHhwumNikoVJX+GUp mnWIJJXCYizNmrw0jyWeY435KiTJdeTzS8V4OR5/bgY+OYI0fdz6l0gSA3PZOQQ+3r5AgSUhTnkdR EmcTAxoPHMwvX+PHZfu079nSBanksCG3TGbFJT7VsIuTWwDtEZITaPwgt5DyFJEYrIAUzaOX7dJZ3 dz+1iw3xoWPVmL+n+fMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuXDk-00HLnC-Jd; Fri, 27 May 2022 10:29:28 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nuXCl-00HLP4-3W for linux-arm-kernel@lists.infradead.org; Fri, 27 May 2022 10:28:28 +0000 Received: by mail-ej1-x629.google.com with SMTP id f9so7984151ejc.0 for ; Fri, 27 May 2022 03:28:24 -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=ndP/m+5H1JvMzkVwLM22/7dPF6mVDOz8cWityZisy7w=; b=N4qtUMw9eCH3aQwUwzVpgULVDpbYOtyXKlxVKlm+9SyP3Zn/8tudautlVEzJ8elE8n O6t6Wyau10+u5zSdHFf9W+3I4lygLpWfU2oKbPUS8J4jnZAGSxCmGSRSS0tPYKwSpr/b nhmSDr5Hn4Dm25mV9gX2muV/sLwh1FH/5bug8= 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=ndP/m+5H1JvMzkVwLM22/7dPF6mVDOz8cWityZisy7w=; b=mXcHAyqYCS+WfxqMvXvVUrPh23sgnbI9W8xyXT6YD4mGTyAAwaAozNhaJ54vbC5Gky 02d1hCQ8xubpjU4rruq0ZKOSG+EsGRKCf9Pb5us6fXAWqht4T81ngxX59i2UJzYFhG5x bAmO9zJF62xcSySnXY9Fg7JJ/x4IPLwVtG35g73Ozs6F513YPei+bSuN5dUeS0ZQbUeI tQ8qjAEoMEaBTuFyLHeKjF/roTxyGE8qXufMWxHtXK/i695PC5a7YwJvNkgUic06OEKp BI2FA1FZ74w2lcW4VdSoEu/IctX51GJrq4QvaIKQ6kjKCotuYO2dhFt6I3ZjNJEjjxwQ D7Jg== X-Gm-Message-State: AOAM531Gkj1xloGU0Q59044iWdKnhNrgLBJ5H2iPX+uHMA918c/t3i2n sm+HbJTR69SWY44I2QEXqbOVFg== X-Google-Smtp-Source: ABdhPJwXDgDGE4kurypuQtW9+QL63Zj67ft6S/4YUjUrlUoeNcCHVQAQ3fujXqJ35JUeLd3io/WDlg== X-Received: by 2002:a17:907:971a:b0:6fe:bdf6:b67e with SMTP id jg26-20020a170907971a00b006febdf6b67emr26024672ejc.312.1653647303477; Fri, 27 May 2022 03:28:23 -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 cf8-20020a170907158800b006fe9e717143sm1312225ejc.94.2022.05.27.03.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 May 2022 03:28:23 -0700 (PDT) Date: Fri, 27 May 2022 12:28:20 +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 v2] media: imx-jpeg: Leave a blank space before the configuration data Message-ID: <20220527102820.GB24226@tom-ThinkPad-T14s-Gen-2i> References: <20220527102444.19683-1-ming.qian@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220527102444.19683-1-ming.qian@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220527_032827_192053_0C0E87C3 X-CRM114-Status: GOOD ( 24.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 27, 2022 at 06:24:44PM +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, > and ignore them as garbage. > then the configuration data can be loaded correctly > > Signed-off-by: Ming Qian > Reviewed-by: Mirela Rabulea > Reviewed-by: Tommaso Merciai > --- > v2 > - add some comments about why the 0x80 offset is needed > drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 9 ++++++++- > 1 file changed, 8 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..c0fd030d0f19 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,13 @@ static unsigned int mxc_jpeg_setup_cfg_stream(void *cfg_stream_vaddr, > u32 fourcc, > u16 w, u16 h) > { > - unsigned int offset = 0; > + /* > + * There is a hardware issue that first 128 bytes of configuration data > + * can't be loaded correctly. > + * To avoid this issue, we need to write the configuration from > + * an offset which should be no less than 0x80 (128 bytes). > + */ > + unsigned int offset = 0x80; > u8 *cfg = (u8 *)cfg_stream_vaddr; > struct mxc_jpeg_sof *sof; > struct mxc_jpeg_sos *sos; > -- > 2.36.1 > Looks good to me! 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel