Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp99961iof; Sun, 5 Jun 2022 22:21:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydw1/Bmx1319FzSt0hgJOE0PVl+ltg0Fh6bAcprE7iiC2xs3/TmdTJjOsp6xNEdzNg+SvL X-Received: by 2002:a17:90a:fb90:b0:1e3:809:9296 with SMTP id cp16-20020a17090afb9000b001e308099296mr24508180pjb.26.1654492906093; Sun, 05 Jun 2022 22:21:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654492906; cv=pass; d=google.com; s=arc-20160816; b=HBIvDHkpYxd21w0Z2cjO3hBYB7lL8rNrU3YyWZ/p6AU28dhZMqNY64heEJhpkGpzYU DsOSVvSnEjpecrmQ+Dh7wAp+qfFVIfFeW53qX8MiMc71I4nRHDkxI8/ke2PdCb5RUm1y s9w48Dl/pkEzHhUtyX3CFGoJIPPT3eS3aEnwzkKSsucy79fOViNupPAWyxe5fnRag0J/ Yn2fcaApqZ0LUPvVZ4/vJlSCmokJmbTveuex1x3Q3eQ5ZYwL25asxoMSyEInmg5epTQy SwUATgsN7y87GdaHoGTW8cSV2IuPJ/gZga4MA1xddn/1nDBXgjmSO7u+CsjJBIiRvuoo Qjbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=B2Fai1R7IfylYcHSkUlyueWN6kQYkJo1H0DDRSYK/Ig=; b=hYY1W5jNfkTdqsnESAnjmsm6VYPyIFfmn8ht5gPhDfk8URFvxOdmG6GrHgMya+9qul pdD0XDGUar8h3MDBN+/5+lcMcdqb/UL49oQQW7rsJtMbikTc8RxlQQgXSeOEXuoo8s3Z EVGZrjJ9W2bEjFUIFo4yRS44JV6ko1P4XdEJA2vjojJg4kzPObxFoH+M9E3uUHGQUGGx 5NlE63h1FtDatkeriO2kqo72U3Q620W+RfKZZjVwIXNdiJch/oOT+W709YnHJTkt4n07 RZCLltDgtfIA3j8y9b2qnQTaRAXLoPzB60mq72bX/A2mRQJl2RQjwBDip9NWg7RnNDIG 58ew== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VWcyhBI3; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pl5-20020a17090b268500b001e299f85017si20423814pjb.63.2022.06.05.22.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:21:46 -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=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=VWcyhBI3; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4D5F644EA; Sun, 5 Jun 2022 21:24:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351264AbiFEQm7 (ORCPT + 99 others); Sun, 5 Jun 2022 12:42:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245118AbiFEQm4 (ORCPT ); Sun, 5 Jun 2022 12:42:56 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130053.outbound.protection.outlook.com [40.107.13.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD1E94B41D; Sun, 5 Jun 2022 09:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vb60Os5neLJHOkHEVohnc9pyCUQBNRhMZLBSbB5QW/hA51mSqj1Ba1b7CIWis6VtyOdNhriENNGxeOxo0ongRUKIgn+Z9wC3SNBXPoorntewAFBwWqIm5TmNjB4P2ASS8fxshEU2oRGM1qzktUwUaxSkxZwEciXRRnLFNrdkgpu9fT3NntljemjJr/JI17B7GbQaUip4Gg5n9ndQt892MxJSN2k10nlT+k0tSWTcpg5Xne/r45NtYWgDxacbHP8w8zuAO3pvIIPJawKVFIYTonkaV+ecf2C58/WeJWiOtu8pfOg/zaQ1zg24Jjs5mRRpovicd6mQETYU6Mhw7zrWsQ== 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=B2Fai1R7IfylYcHSkUlyueWN6kQYkJo1H0DDRSYK/Ig=; b=nDuRyLwEfJBZWnou30YHqgAHW2wZ+Ho0ahaDDNdpUYAshCYJJrH0hyN8kdLgrgx9Ju14TTm8gCWWvHkRh/gSSMYoiaTjZ08/8n+jKSM00HHvY4KyIfqydYJOtAzSYe0P8+wLoWErjjxro5vQvg5QBi6nj4h5JEIX0bW9cKgIP6GamBXcbgLhwK7n4mtkP/+JBODCjjLoh2VnMP9zLXSb3wS2e6rdoQ0Ukg9Hi8YRwILcW8tV8esdiVXVtVW1esMUOmk0Y9ejlfABfvABPC8FW6y8IqAhDG422Ej8AWQY+XVsLV8HNK4THDpd+KPClnGVmp53h7DWDcAeKjrBS9OUiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B2Fai1R7IfylYcHSkUlyueWN6kQYkJo1H0DDRSYK/Ig=; b=VWcyhBI3u0qHQmLfJV/PO4WIAAAVLkYxehCzQ/Ewl9zoFKvOjkCffOJYKckn41neQYXdpZN0lJlVGE+Yfhn9EcAP9LYflJ1qsGKn5uzBQaG8r7I/qBvCArOX037jS8VoSnqaDmXVhSfeit8NnWG3IeN2yHr65rMXFd7al5hWQAs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AS4PR04MB9244.eurprd04.prod.outlook.com (2603:10a6:20b:4e3::9) by AM0PR04MB5860.eurprd04.prod.outlook.com (2603:10a6:208:133::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.18; Sun, 5 Jun 2022 16:42:51 +0000 Received: from AS4PR04MB9244.eurprd04.prod.outlook.com ([fe80::60ed:7367:9545:512f]) by AS4PR04MB9244.eurprd04.prod.outlook.com ([fe80::60ed:7367:9545:512f%8]) with mapi id 15.20.5314.015; Sun, 5 Jun 2022 16:42:51 +0000 Message-ID: <69817804-a618-32ba-06ca-3ec38ff1f124@oss.nxp.com> Date: Sun, 5 Jun 2022 19:42:48 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v2] media: imx-jpeg: Disable some unused interrupt Content-Language: en-US To: Ming Qian , mchehab@kernel.org, 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 References: <20220530074756.14585-1-ming.qian@nxp.com> From: "mirela.rabulea@oss.nxp.com" In-Reply-To: <20220530074756.14585-1-ming.qian@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM9P192CA0001.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:21d::6) To AS4PR04MB9244.eurprd04.prod.outlook.com (2603:10a6:20b:4e3::9) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 346fe31d-1e19-4430-cd6a-08da47126e7d X-MS-TrafficTypeDiagnostic: AM0PR04MB5860:EE_ X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True 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: gAPQ0BhICjbRQfqbTgHEYqu3+7MiKZGx5exiHDFxxZRHhWVyMbGnMMoZoDSl8GJmaM1BHbU8L3BLaZaQ0Kbxe4R2g+d+YjFu9xk9G1apg9L03htyOAd1TBYrI8UYlxoiIeYLwWoVS4I2YxvihUmfNXL6Bz28eOQ0a56C2RSBSDSmvCOT6NhtCdBqn1dYjKvkyBgG/DP4ZQWVdkMyPNQNDXR0iSDJ582rTrv8KjtgxpdixLqvEA3CgYHtg7g8imuJ4QQ1RljP2KlVS25/QDHn6TNuUiFhWx/8XiElH3QnKbgIHvLe8/LOMVO2EZKPNssUIlOESUW+xnM1cKNIDuC73+TIDO3ZqRltrIs/ovaGEbn7JpB6J813NWkbVYGCjUauk/gHywfBpZATRKhgsG6jPCLpkrG9DIR4wnCw98mYysyEUug3jU2UHRaAdUtDeu/3L0LQCFMjhv41/D8Pk1eKfpA/gr8hYnBOUSbupjQ8qs1d3Hd8keaOn2qSbJ4hF2rwLaEfnJrwN8Nz82OyLcosMKRqc3AIslXB1akZfPcqfF4DvWz5PakShqNGtJv9otn8k8CVtUZ7pMFYV+tAHdLhPTABi8ujzSSwL3fLX6rZCSdHSkgzTRuboNXgOx2EInFbGqhiqToQ2WPrfjRUWL4XAOzfRsv2oMGojMPqJreCo1EjyFMeLFIaB8wV9Jq4QGleo+8mPfAotahwoNjhpA0xMYy0WnmIntcpeD7nfMa4+lbb32Y/VyFVseIBYnRjzQ6gaBA6rtzWyQHnydrBcs/vNw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR04MB9244.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(316002)(5660300002)(6666004)(2906002)(53546011)(52116002)(8936002)(6506007)(7416002)(4326008)(2616005)(8676002)(31696002)(186003)(66946007)(66476007)(66556008)(38350700002)(83380400001)(38100700002)(26005)(6512007)(31686004)(86362001)(6486002)(508600001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aW5nL0VqNStmOUIyZTJrU1Y0aU5pdFRlYm0wemllVWdzaWN3NS9SSnZ3TnhY?= =?utf-8?B?WEJwYjZyRWM0ZXBkdXA4MElLZGw1NndqU3JIQ1BsWlVlYVc0cFRmVGlHNVd0?= =?utf-8?B?Yi9ZREQ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NXlwL2xT?= =?utf-8?B?MFV5YWVvZDZMTEIrUW8zZ2JHZSswTXg4TUoyd2g4SDJtV1ovM0k2aUhaejAv?= =?utf-8?B?bG0xUFY5YSticzNuNEhDS1g3Sjk5V0JKQnRFSnh0cDQ2cW9sRTVVSXRYb2JZ?= =?utf-8?B?SDd4T0dWUHBvUCtXbm54ZEJ1K2xMSnl5VkpVakcrbUh6U3RmVnN0c2VNNFlV?= =?utf-8?B?T1BnSSt3TXAxajZsVGlrcVdKTFB2THhTZWFmeXZzdXFQUFBjc0pTa2YwL0hr?= =?utf-8?B?RmZXU2pUZ29xTGxvb2U5Z1d4MEwrZlI0U1dIQmdHa0tEZVAvcHp2amg1YTNv?= =?utf-8?B?eTduK1QxTFAwWFJ0TzlndmdQaFY1OW04QjMvZlo1NU1qdXB2djU5aFZ3T1Bs?= =?utf-8?B?VEdLWE1sZzd0aFlnNGhDK1hSUGlZV3FsZTBkWm01TFRYaExpbmZ2a2V5MHRF?= =?utf-8?Q?J3fzaL/+vitp9mJo=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 346fe31d-1e19-4430-cd6a-08da47126e7d X-MS-Exchange-CrossTenant-AuthSource: AS4PR04MB9244.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2022 16:42:51.6005 (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: fiukZXcRSwbfhn48bdok2wYXhV+toPACNh7RYnQCYTPqVRl70rZkeMkMR1g+W93XGPD0VKtwO8UarLGwp6JAeg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5860 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, On 30.05.2022 10:47, Ming Qian wrote: > The interrupt STMBUF_HALF may be triggered after frame done. > It may led to system hang if driver try to access the register after > power off. > And interrupt STMBUF_HALF and STMBUF_RTND have no other effect. > So disable them and the unused interrupts. > > Fixes: 2db16c6ed72ce ("media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder") > Signed-off-by: Ming Qian > --- > v2 > - add Fixes tag > drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 c482228262a3..258fbee7ab66 100644 > --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c > +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg-hw.c > @@ -76,7 +76,7 @@ void print_wrapper_info(struct device *dev, void __iomem *reg) > > void mxc_jpeg_enable_irq(void __iomem *reg, int slot) > { > - writel(0xFFFFFFFF, reg + MXC_SLOT_OFFSET(slot, SLOT_IRQ_EN)); > + writel(0xF0C, reg + MXC_SLOT_OFFSET(slot, SLOT_IRQ_EN)); There is another way, less aggressive, to go around this, disable all the interrupts once FRMDONE is received (or some other error condition), interrupts will get re-enabled at the next device_run. I checked this works, in mxc_jpeg_dec_irq: buffers_done: writel(0x0, reg + MXC_SLOT_OFFSET(slot, SLOT_IRQ_EN)); Either way, I would also replace this: if (!ctx) { dev_err(dev, "Instance released before the end of transaction.\n"); /* soft reset only resets internal state, not registers */ mxc_jpeg_sw_reset(reg); /* clear all interrupts */ writel(0xFFFFFFFF, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); goto job_unlock; } With something like: BUG_ON(!ctx) The initial intent of this code was to cope with the same problem, STMBUF_HALF interrupt received after FRMDONE, which could not be cleared, but it was not done right, I can see the hang in some rare cases. We should not run into it anymore, with interrupts disabled, either the way you proposed, or mine. Regards, Mirela > } > > void mxc_jpeg_sw_reset(void __iomem *reg)