Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp1555974rwj; Sun, 18 Dec 2022 10:29:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf4z0UMoaow8bsZ3HER+wa+HK+6XnrL+qHWElszcVMAP0xv1uj35mLesYP8LZbMk/AI2YQgl X-Received: by 2002:a17:903:1014:b0:189:9cfd:be73 with SMTP id a20-20020a170903101400b001899cfdbe73mr34466685plb.44.1671388163539; Sun, 18 Dec 2022 10:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671388163; cv=none; d=google.com; s=arc-20160816; b=GR+7QF4W8gxo9KaWFd4U0xhbW71MjL6D89b7/RmCJNMcU/MyQduL7a4rK7iGGB1MwE t0yLTGrXfCoIRYG1eoLujr8PcONY0BvC4mXj5h3bGlyKy5oT7hJgBM11kyWi+ShiuCFd DSwP3eh2FCgVBn5aezFknG1AZ2uEPSPggawxGzH61Hg5dZ/guFumkBXgGuaJksmN2sFX kRvcYb80WSG4Aa7YgXUOyo06FGZB6zkTnEnifWqOE4Y8Tyh5oRt9fLhlt8tRb2btg/gG g1+UckvDzl8zcp90TuX6PK1WJe0n567Z65nYuf5UXGPCYUoi269F71XgbO75PrUkTAvR ZY2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/T9A255NJ4qsXseLWx0aFgV5yY9HvjwzYd8EDKQbjwM=; b=M4fqHZ1iwoTcUSvXgJt4iBc2OT9fueCI9nuuaQn18ZASqrxNXn4Inl0mO1QBWMWxtK 1igkg7nJVdAHlmwgKMPQ70TOL+VNCt13EtZ7lgEg6MNyw2cRjWGgY50mTc3T+uWEiZq3 jKoOObuetiEyUkozG5x2h2XljRJOBDXnW3jDUe5ACWFNYmutW+jor6bC2zjp48bSLR2x Rpezru9CfnqArkDiM1kJGQvrZWiLlEeNHEjmyloDhCJZBJdpBmTp+Ect8H2Y2BT7cAQo doHIvsodTRJZkS7ZqbxrVsYqi1eIWJ3yUKsOrEVxgLnF44P+p/Dm+5ff8aJ7dThGzOTA AtzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSjEpQVV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z4-20020a170902d54400b001895a1d382dsi8499444plf.451.2022.12.18.10.29.12; Sun, 18 Dec 2022 10:29:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mSjEpQVV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232098AbiLRQfu (ORCPT + 70 others); Sun, 18 Dec 2022 11:35:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232020AbiLRQeI (ORCPT ); Sun, 18 Dec 2022 11:34:08 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC5C8E009; Sun, 18 Dec 2022 08:12:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AD831B80BA4; Sun, 18 Dec 2022 16:12:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4469EC433D2; Sun, 18 Dec 2022 16:12:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671379973; bh=5+ZQXrFg6ZmJxZDs0YrFxEzV/Yh9SfNFj2b9O/xjFBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mSjEpQVVxY4LRwS16dxhipkH7QnaNw9HpinVoWw4FY2B8+Tlm6s6GrcFFyggydkrz mcbQq9pTB0CaodOHz8B17dcv8HjcyJa9mcdYMw/cnpeiFPYPLD9wGnKBmMU9jxy6yw PcX3z1xJVqYzKvVJnvm49lJAiDGdMQA6ptu/YjXlZBUM+GJENP5pwstKVg76z3WAm2 zD2MRxAR5Y9frjF/wdhhOdoPwQCciMLH6GniQ95phkqK825rt3bYfAwSr++cZlYIFh A8VZza3aPDfb3wGGJ76NjQNJ8jg0ssAX7I2Mj6fGDWMz/x9TOr13N/WRJai1fZrbNp LAkJZ44t7NfGA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ming Qian , Mirela Rabulea , Hans Verkuil , Sasha Levin , mchehab@kernel.org, shawnguo@kernel.org, laurent.pinchart@ideasonboard.com, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 02/46] media: imx-jpeg: Disable useless interrupt to avoid kernel panic Date: Sun, 18 Dec 2022 11:12:00 -0500 Message-Id: <20221218161244.930785-2-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221218161244.930785-1-sashal@kernel.org> References: <20221218161244.930785-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 From: Ming Qian [ Upstream commit c3720e65c9013a7b2a5dbb63e6bf6d74a35dd894 ] There is a hardware bug that the interrupt STMBUF_HALF may be triggered after or when disable interrupt. It may led to unexpected kernel panic. And interrupt STMBUF_HALF and STMBUF_RTND have no other effect. So disable them and the unused interrupts. meanwhile clear the interrupt status when disable interrupt. Signed-off-by: Ming Qian Reviewed-by: Mirela Rabulea Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/imx-jpeg/mxc-jpeg-hw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg-hw.c b/drivers/media/platform/imx-jpeg/mxc-jpeg-hw.c index 718b7b08f93e..8936d5ce886c 100644 --- a/drivers/media/platform/imx-jpeg/mxc-jpeg-hw.c +++ b/drivers/media/platform/imx-jpeg/mxc-jpeg-hw.c @@ -76,12 +76,14 @@ 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(0xFFFFFFFF, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); + writel(0xF0C, reg + MXC_SLOT_OFFSET(slot, SLOT_IRQ_EN)); } void mxc_jpeg_disable_irq(void __iomem *reg, int slot) { writel(0x0, reg + MXC_SLOT_OFFSET(slot, SLOT_IRQ_EN)); + writel(0xFFFFFFFF, reg + MXC_SLOT_OFFSET(slot, SLOT_STATUS)); } void mxc_jpeg_sw_reset(void __iomem *reg) -- 2.35.1