From patchwork Wed Mar 22 05:13:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13183579 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 42041C6FD1F for ; Wed, 22 Mar 2023 05:30:59 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PFJeiYVeqd6+8+o4cZl0Q5W+5lC5vgARtkDsn+j0/xY=; b=x4f9BQaT1CiKx/ AeP8/hHTSghy1ypIQX9Z8kJvGJHwP43sEM45eSw4toH2pAB4oLifJEuyaQ7fTGwNc2ERx/juayzRk IFV9dz3uvG2wt+Dp6B8VNPVsDS5vYGiD/4GiNX/hydSDx0tSUV31ZP8GR5+GBqoFm3QQNpdpfZ9Dv mwde6b/VOH5gaMRtzi+v+oo5i0nTK16JyPqZjM3AwnywmYXw3ZrI9zFXro3ds9W0KJP+JfcJxwijv bHmeJ8f56uVTQ7JkB+FxfSCYj1rYDjDQyjtFsYvKsW9F0ElHklrVo4nlGXYh8AoYV6SfEBOCeNPzF eWgBA+hamIRFCViJge9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1per2O-00EiRE-0v; Wed, 22 Mar 2023 05:29:28 +0000 Received: from mail-am7eur03on20611.outbound.protection.outlook.com ([2a01:111:f400:7eaf::611] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1per2M-00EiPo-09 for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 05:29:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OglWgR3IfBSW10yTiRHSBmHpm9/if4BLeNTizbXilxgS9zJtk5ZT9GLrDHuJVZ1FYcjxqvFLBrLZX0k2xjHD3SN106j6MftoxVsCeEZAIJYJhWZQSkB/wKIf/54baVXHWj9xkru7qGc7pbpZnA2JBGOq1NOBdP2TtUv55FhOLKxXYCtbV0Vt1TzkDZxJU9Ov63Gip0+cA94HMNDQByoOncypLo1Bw5NNAg1Uv/EUcxmjli7k/ExOYP1+prXLDyWuVwEXvFxOZrg1AYEzYu42g0CkLVkCTsC9MdB1vK1WzRxc0wN+JlwfgZEwPTnglU1yrRX0kgPfFC0YzmP4BSwrDg== 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=DWE2v7gcmTZgAjF135o2R8bWHo+YHguXRwe76ddTpZg=; b=efsL2KsH5CpGbzhi71D6hgAHO/ISmmEzT1IriMLigsHPqi6zGkSpi45SdvgydD/XZwQjZHgdlMuky5s61z+AUG6TqTBkdmZuGuUvuZo4I1xQ1kRLWqKScmPbrrl/H2kzqAj0BD1PLWTShgV4j51B3f2JXN9loWdVkkqIxxLNK04wEjhHvS9AQjCi45yaa6RZw3bdk/K15XWWooT0lkFMrp4ubb/b1z5E/LCjnC9YuJakF/vu/tze3oh2iuN2s/oJZKaAXwWP4epZe4G905N2TwUD7PqSzw6VqrVZCH/TOKKJpUUNg2rdjHbSTBSkw0PSalfQNKsTjJYZriztvXWZOg== 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=DWE2v7gcmTZgAjF135o2R8bWHo+YHguXRwe76ddTpZg=; b=l2ooSAChFYUpBftK5jYMIIxAl5bGiISONWtq4d9iPtk/w9pcJDKgm3WHWGlogi5/WEHvZzWACepugcNEHxWDw+i5b/SfoIj2EHFHwTJJRR7edIRUiaD3lw8NmW+U5yUKsay7Fpqiv1NZ3610nph1BVmx4tVzP6EkZMVbRb5ye2U= 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 AM9PR04MB8100.eurprd04.prod.outlook.com (2603:10a6:20b:3e3::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Wed, 22 Mar 2023 05:14:13 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::89aa:9204:790d:e46b]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::89aa:9204:790d:e46b%5]) with mapi id 15.20.6178.037; Wed, 22 Mar 2023 05:14:13 +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, xiahong.bao@nxp.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 v5 08/10] media: imx-jpeg: Clear slot next desc ptr if config error Date: Wed, 22 Mar 2023 13:13:11 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0021.apcprd02.prod.outlook.com (2603:1096:4:1f4::14) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AM9PR04MB8100:EE_ X-MS-Office365-Filtering-Correlation-Id: d8021e41-8ef8-4f6c-78a6-08db2a9446b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mxuIISw4QOahI6PHeg0cdzuiXBkp9h+5I9I5LBVGHZs/B+DBLRcLS+NPgVIcT6YJSyIibRpL+2IEXW2EColsu5RjMelqjVyPXwvSakPepHRcrSkXxNCWC9lV+/YLz/eQlN7HNczGWONzWmxPslD63hW9ciVvcjVbo3ta8kVPeBaLj5mz9aEdnD7ktlqYqVK0O5hSF31cVHHiVEOOwFi6SbFqFY9P9qjn++FBf6fA1UnakFpsMsnW6Rb77nR/aLbxs9aTU49O4D+Uvek41+G8wjHcnavIBfX6Hta6f1CPJHnU3QnA6LTJc/MpTBDYaX/gGlYWrh0h63ysSwky/RQcHz52lZoKL8PJ3OxIjMPAwTT2hrpsiCKFJCmB2KMcjohRxP/S3YXIK7M9tFiIoqrl6gmL1i+UqJSENAqmpj2lBOA7jp3B+hvmWaxDqrSroeFei1bA/dRyF5HY0MQmSoaBvj5Lrrc0pskzFsFI6Ie9AEf0OTjdQnS8jLsPoOI7MQSYJ2I15SfTthPQiBJJtQi9QhYZoBzcRgmuv1CRPerQVnQQV15pzDciT6ej3sQRIwcoySVFvNnZb1g0U7EwaaFq+I9+YrBN9qFjh95ygOmRCdfPfNJawJAQu74/oddfcpEX56E1bxRP7iKTUg8tFO+AcCbY6eIhK7d2XJRn+mmbbL//bP+F5eB7MHRHtiR0rBugktuikfGkND6JRSe1oVFDXA== 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:(13230025)(4636009)(346002)(366004)(136003)(39860400002)(376002)(396003)(451199018)(6486002)(66556008)(41300700001)(52116002)(66476007)(7416002)(478600001)(66946007)(5660300002)(8936002)(8676002)(316002)(44832011)(4326008)(36756003)(86362001)(6506007)(6512007)(186003)(26005)(2616005)(2906002)(38350700002)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P5eE67KO8+UKJCf5yMGAr3paQOmVsyFhMW1cFaMpZrbn//hDbK1R2KGR3Dq3Isrp+NO+x0A40cpnPCFrDwnIfmGDmw9ahuzo61NCz3UoRVSeWr1GlcgfCW5bxIivdCbHX1ZrfS47zw07Ut7Q5df7WE2FfM60wQC49R4AjyF7+70uwqsBAzPhw8+acer9PXPMEHfS1/xBJDRbBytrGd3Gpwbu57493WEFcZKIWjhDY6j9PB8cbBK9cjBvGKW/OfzNBYq2iJ5dXP2ZnzME7mNgdE4J/fKf97e7bHn3g0OvFHuJDtXhKg5YCYuFYMkeeGrIXROUpEi9DeaputOSYPLOIPCbdDutm0s2bzP1+4qrTiDJDTD13bDQA1JbxHsy9U1loYmHO6qlS3QP1VoBLJAPbH39lMGuZvS54ErF51MihRENnJIHWlPbyCXxJVm0ZkLul+JEHc/9iA1Yab7xlvopQv/KitbFpVSPsfATkz7ZOgWQhOnLmIDr8T+oiHaiznelZ1lL2qL+ai9SFczJswo/MtLs/UbmpkSHvTh+YaN/WABj0wONQnqcs6CasQeTabs4y8dJRj0YZ2DksOvRLk7k+jPlmaXv2AtY5fJXGCBaLbFpcpzvNcHAGa/lvpWcFdegPHc0fKi5BbmLMDXH9Q0/RICT94VKHXWG0z3VL91E8c/OH28008+j2BdSkDoECkhKcm00Ovm8hIuYOv5xXe9a6hD8OWF3zbd84mAtT94Xt079l/kdBKuFishmyZTZB7ScoNEWeupOQsP939dMObmuLYuuwOlDKdmNpG+ATQC/ErpIPLxf6FbHzXzL5paHokeJ/ctXAoG8iBF+0XaFBBsz1AQKr95hIjy/Z9B5OLSVVNdlD40LfAueONKwLkMbXTDKEoUbCDkB6QpLyl1OdnGhj3Wr/e8Ur5Jfi9cI2F3eSSaIZT8ccknVkY60DnsbJ3SQz73tJnaJFAzIAxZg52vylPiDO8671yL/lC2NmphkLzs7n0jEeYpyCqD9OnngaT+9FNhezSz6GGPPiMbbMFTmUOiz3Mq5cqmFeo1sGBP5HttPBeqSUfH1XTImsmrylSuNuC1kgDHMNmFBipPoUpoCkk5dFH82lwl4anPbWM6ajKT35UzZIrhaYJ5PMuv/Bi4dyDBa6Y5Yge/VVZATzWfHgzSggAjBFVfIuwl86VWfgnYL8dwX8r2ui7eZY0Vu2pB0d5Lor5cgevBHQvclo+lTEPSvBYdmx4zsDKWbwepx7azNhkkcU7z1LYsMeUAvFNR3QQBNwHn4qybDoQ9OZerYhT4kvFmNQm4GWK3JFaagb2wYDcCJNUa6GgghitYXnNtmjGaK9kPTt3S2keY5fH05GXqAVWzsCm3R9VD7dZ0QV6jmUWcsvvlLIAx1am1x9dFBAeRjv04hxT46axJ75AnHzIZkL2gITpJSOZykajNd0pzWdZSTXKYGuPzcWNOE633GjHEhsNubxERsosRvv+Lp2e3XpPly0wiZFmWCsJEgvh37//Shy/1D07UfrqxMVJ8S6CdSH5/JwVWb/3T6q4dyvKavG0acSBDvIlMnHgSESSNkT/JhtxZaIt8p8ElrUPPo X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8021e41-8ef8-4f6c-78a6-08db2a9446b0 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 05:14:13.5366 (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: ppsIuXNYxebVKZgEWxBqslZI77BDKgk+rSVv6vPeDeex+6IK96EzIxRWFVP3//MLuh3Pl5xM3Kk+VnccdUMbOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230321_222926_088647_27843946 X-CRM114-Status: GOOD ( 12.01 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org clear slot next desc ptr if config error, otherwise codec will report config error interrupt repeatedly, it may led to system hang. Signed-off-by: Ming Qian --- drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c | 5 +++++ drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h | 1 + drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 1 + 3 files changed, 7 insertions(+) diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c index ef28122a5ed4..bbd5d6a9fc86 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c @@ -178,3 +178,8 @@ void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot) writel(desc | MXC_NXT_DESCPT_EN, reg + MXC_SLOT_OFFSET(slot, SLOT_NXT_DESCPT_PTR)); } + +void mxc_jpeg_clr_desc(void __iomem *reg, int slot) +{ + writel(0, reg + MXC_SLOT_OFFSET(slot, SLOT_NXT_DESCPT_PTR)); +} diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h index ecf3b6562ba2..8b7cd6526efd 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.h @@ -137,6 +137,7 @@ void mxc_jpeg_set_bufsize(struct mxc_jpeg_desc *desc, u32 bufsize); void mxc_jpeg_set_res(struct mxc_jpeg_desc *desc, u16 w, u16 h); void mxc_jpeg_set_line_pitch(struct mxc_jpeg_desc *desc, u32 line_pitch); void mxc_jpeg_set_desc(u32 desc, void __iomem *reg, int slot); +void mxc_jpeg_clr_desc(void __iomem *reg, int slot); void mxc_jpeg_set_regs_from_desc(struct mxc_jpeg_desc *desc, void __iomem *reg); #endif diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index 70b6eea733e7..3f1c9bc4b144 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -692,6 +692,7 @@ static irqreturn_t mxc_jpeg_dec_irq(int irq, void *priv) u32 ret = readl(reg + CAST_STATUS12); dev_err(dev, "Encoder/decoder error, status=0x%08x", ret); + mxc_jpeg_clr_desc(reg, slot); mxc_jpeg_sw_reset(reg); buf_state = VB2_BUF_STATE_ERROR; goto buffers_done;