From patchwork Fri May 27 07:54:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 12863090 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3D56C4332F for ; Fri, 27 May 2022 07:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348608AbiE0H42 (ORCPT ); Fri, 27 May 2022 03:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348426AbiE0H4Z (ORCPT ); Fri, 27 May 2022 03:56:25 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2065.outbound.protection.outlook.com [40.107.21.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1786D22BFD; Fri, 27 May 2022 00:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DbnkyUjjRGp2LsAoJiEQjQZT8sp+Ndq/KUEh6qUl5500x1fzMhMyFTRKR/SZrkCQRknR2IBS3AA4JbrkkoBDcm2P1rguqtr11myAEmYSWiPQNpw+X0zEuldn+7ObPYxKrChQUPRnOBgjyP8EIoiOV7awoBTXw23vI6XCFQpX8TQY7EroBpBB8ZSkFvGjOoXqc9udLUjdH1LDdcldhHKu3vjxE6Eou7FJSmbxWMtFEVUnPaWakOLhr29z7BwNdAKvoDoCqhvOOjlFCYA9ErwwFhD3TvH9M8ZKajo4sr5XPtCdvnseMzZ9MdRJtboJsWtOf5/htMlbAq5fS5B/60QsKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zn9KcAJpl7bMxZlfZUZj4TiNiAX2Q3bkG91s76yuZys=; b=NOepxDtGX9gIHeul6xSW7rB/psjsc08xAMsuPBdupCkzWzn+k4sYd3zsIPa9VRKobJlt6+xDTSik1XENVL269zwpUn7F75BeTmBiXLRlUEcIi/nMkW2RobjXcpg1zFTNoPzz3Gj20mE45WakAI9ahFlK7VxEVzspWLcXId3V0gDsj5Kum4B+O5AUtjaBAB0OM6q/ETcWsYLa94ZFze6ZGjLPrimbP6rnluHD4KqhNFfA9U+zp2QJ77XuNBFgwBSfJkkQRsglyO//AzfqzrjP1GvGolxbtgmJysuxG3k3nXKdGPev7CzEULeUGN4aI8J3tus5zmKVQS4VMYfcojCisg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Zn9KcAJpl7bMxZlfZUZj4TiNiAX2Q3bkG91s76yuZys=; b=gYR2ttwNklIUH/p8Jeu3uIRAB0lxfmcnuaso85VIeyjFlCNgW6Y5Fjfih5aTA1+xbNWmUE35SNEZ91UCeCw+t/oB1ii3R8loyabjU1e84Gl3nGSFja3iFAfTLHILccXIDlgAwKd4DxZJ4unueo0Ls17XdoEI/ZcxMlc1kzdJBoY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by VI1PR04MB4590.eurprd04.prod.outlook.com (2603:10a6:803:6d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Fri, 27 May 2022 07:56:16 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::bc48:7565:c619:62c3]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::bc48:7565:c619:62c3%7]) with mapi id 15.20.5293.015; Fri, 27 May 2022 07:56:16 +0000 From: Ming Qian To: mchehab@kernel.org, mirela.rabulea@oss.nxp.com, hverkuil-cisco@xs4all.nl Cc: 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: [PATCH] media: imx-jpeg: Leave a blank space before the configuration data Date: Fri, 27 May 2022 15:54:35 +0800 Message-Id: <20220527075437.16882-3-ming.qian@nxp.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220527075437.16882-1-ming.qian@nxp.com> References: <20220527075437.16882-1-ming.qian@nxp.com> X-ClientProxiedBy: SI2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:4:186::9) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77227141-8d07-435e-5032-08da3fb66068 X-MS-TrafficTypeDiagnostic: VI1PR04MB4590:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YFsQSmhaBOcFL8/YIVWri4mLN5Epz89V8Y7H42DjciIkOxcUyseeVbNFNy2JufT/YVgG1dRu2QalWaCe1cDZSsnBA9ARA76dqXP6vxJBREXlvJb425TroLxLNybl89xvkQsQu6YY1DOjMaNLy5qDMwSZb6pMIroOqI8jfiMcHLTU7UsSNVMCbb369WVasouonMtmEN6cwFn9xVykJ9x22FYWPsYcfkTAr9KP3W4Pmb0KNreON/slhjQ1kvy6nZzl2YQV3qEIzuKR/rByjT7U/x/QA0gfpu6Rg1bXzHoDHP1NJi6QHfuGrPMWmfH3zvCPQxG64QEaL0l57I5YPd/GRGj7Kd/C1oeal4uPzci+E8ZU7gIj8K0j5JmPoz8Wevjw0P+VK3SZOs3pxsQJttZ6FcgOQPMeVvD0HRB1o3hK7m9Uv8dsauefvAd50I8Rkpf6WdjzyONA6ZKeKJFD12RuPJkSDdi4Q6F13kZLK0otYcaZOQZpn5vwMDQXrLUEXARG5TuzUqE0Ugm3Gz6J5XOX0kDKquS9EK7TgxJrq4KMPK9aCUeDBWyS0j4Fq2nYgMat4RdPzVh66PRHJlArDthcHo4PHhT1wwpHoirPvsotwwcvYXw48h/zVi3dBz16JVWpt+9wyqVl700yZkJaprUOMdovTebyXwvTvoz88OdcZWyzZ/2EElH+SXROeSxA9AKLTdZI8W4Nc/v8s+qvDK5uww== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(66946007)(86362001)(4326008)(8676002)(38350700002)(66476007)(66556008)(2906002)(38100700002)(316002)(36756003)(6666004)(52116002)(6506007)(83380400001)(44832011)(2616005)(6512007)(186003)(1076003)(26005)(508600001)(6486002)(8936002)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZqRPY2hTTv0BY1lHETj2fcZ7sKjI5KarFlDOhlMlRVSjWc9AMTZvhbootk7t664CwbONr0VquvUycZFFs9g6StOHjFQFg4LMe1DMeRqtRLbxyORVXI7Rq9ycrjycQu21hQsijHwOB1avZf+uvY6PuZZ39icLGQm78Xjo8rYBlDXrx62gvN8NKqGvJhvG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1jtjdmD0PL9EIimW2CrIkAgKgSFyPgIMCupQumY++03FxXa9cgFkA/nb1MMz2eRlHlmGWAmO56Flt3Xo6Pbwq9WWMJvE4K8sptzMMeXIeMmUViC2e2hFYlelm2lXwzTjA6TMAQyLsNv8dyHVt+2qLgcnZzAM9SK5G+okt4N0rE7wwNCfTs8GIQLj9ZwKA8kCd5rXX9zT5K7Duz00I67D60ObqBqZWVsSpGNkfSHld/uSJM48c+R7JHzjpYsUw8XT+ZUtXwyxtQN9T4X+5CnIGvsD09mbD7mAXZAv5Btiteaj//Jv+jDAMJ8YGjRvGyGlQhsRBNzQlEtl5XK9z6acvNsISdh1cvYhZCcOw+Oo3STTFHbOPIW2RxoHMbzFwl4DFAyOq0pI+FlvQ+tWZ5rK6HJkDN3uUoShYC9wgIZ88WDAn4zIXtnJaNXmqSXOpub/V27l2sO+P2JbjUOw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77227141-8d07-435e-5032-08da3fb66068 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2022 07:56:16.3830 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AtM1vrni8h1n4QTqeUM7+V+CA4JUE0G92rYj1UgjGCyFBcEZA0xF0kM3yU5wPHxe08R2vuwWT+fWiVyN7C728Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4590 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 --- 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;