From patchwork Wed Sep 7 10:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smitha T Murthy X-Patchwork-Id: 12968991 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 935F4C54EE9 for ; Wed, 7 Sep 2022 13:44:13 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=2xfBaLdX+OHxzFnPyqd0rtES5AzIq8v98kug4QGsGOw=; b=m91YtkR9QrewO4 J1RtH3w3yo3lTKVdveHWwKHAoP0WH3LIusgjTEG+h0gdVZYw+OWMO2Q14cFrySij5Y1FXilXHtVbo 3c5H7Aughe4Hw+Q2aIGIC3OlAQBZoewtGkjJ6n9/PcbPrE+Lf1RBaiQ0wIw2cPU3nPNekv+hjwDoY /X4wH2SRAnosRweAM9jPVNSlSVJ++RVk3OAz5jo25eQOCmGhWDaI9f5kIobzpcdOmcXHzxqSwmDLb wxcXi5uU0atS24sfd2RVpAd3EJ0ZJ50CiqJvKfCrEJ2C/iZgTlv3j0FJ7fuHxgOhPVwVADpliqAaG NTWU9CavMnJ3/gWRenYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVvKY-006ZwR-H7; Wed, 07 Sep 2022 13:43:02 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVvKK-006Zpd-VJ for linux-arm-kernel@lists.infradead.org; Wed, 07 Sep 2022 13:42:52 +0000 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20220907134236epoutp02eae6a67bda745cfd8260cd4366b05c0e~Sl9WqBYZD1739917399epoutp02z for ; Wed, 7 Sep 2022 13:42:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20220907134236epoutp02eae6a67bda745cfd8260cd4366b05c0e~Sl9WqBYZD1739917399epoutp02z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1662558156; bh=uKppsoNnbbL+dhUZLkGDMSWsNgwF5YdpFD8OZ4YqNIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f3nwaDuc483HcpxWzjrnkiTScdusDC2+K5+KSyMEWzcb78ofSCZUneEGsj/LXVKQK k3McfNmkHf7rfTNIytjkginuRl7kJYa1Xe4auBlSoHtSjhJGuQeiP4/kJkxLupjnI2 4qxQt8O3P8hRtRGX9zS4a3kEzxbT+IkcQUhUTAxA= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20220907134235epcas5p49f392d6e525cb8459cfab7df0a4b0f41~Sl9WMhKqN2674426744epcas5p4M; Wed, 7 Sep 2022 13:42:35 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.176]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4MN3N92ytbz4x9Pp; Wed, 7 Sep 2022 13:42:33 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id FA.76.54060.9CF98136; Wed, 7 Sep 2022 22:42:33 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20220907101825epcas5p321eaebfafa5f69a9695d4b12532eccfd~SjLFDTbJ81838818388epcas5p37; Wed, 7 Sep 2022 10:18:25 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220907101825epsmtrp2970b3a9d4e4dd6e1878b16969760feaf~SjLFCTXPR2177721777epsmtrp2E; Wed, 7 Sep 2022 10:18:25 +0000 (GMT) X-AuditID: b6c32a4b-be1ff7000000d32c-49-63189fc90da4 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5A.B5.14392.1FF68136; Wed, 7 Sep 2022 19:18:25 +0900 (KST) Received: from Jaguar.sa.corp.samsungelectronics.net (unknown [107.109.115.6]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220907101823epsmtip1cc68be055fa7e75fa830ad8da451dde9~SjLDGOn923176031760epsmtip1m; Wed, 7 Sep 2022 10:18:23 +0000 (GMT) From: Smitha T Murthy To: linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, andrzej.hajda@intel.com, mchehab@kernel.org, alim.akhtar@samsung.com, aswani.reddy@samsung.com, pankaj.dubey@samsung.com, linux-fsd@tesla.com, aakarsh.jain@samsung.com, Smitha T Murthy , stable@vger.kernel.org Subject: [PATCH 2/3] media: s5p-mfc: Clear workbit to handle error condition Date: Wed, 7 Sep 2022 16:02:26 +0530 Message-Id: <20220907103227.61088-2-smitha.t@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220907103227.61088-1-smitha.t@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgk+LIzCtJLcpLzFFi42LZdlhTS/fkfI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Vc VJwIAPSmdPbJAgAA X-CMS-MailID: 20220907101825epcas5p321eaebfafa5f69a9695d4b12532eccfd X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220907101825epcas5p321eaebfafa5f69a9695d4b12532eccfd References: <20220907103227.61088-1-smitha.t@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220907_064249_391368_095FEF9B X-CRM114-Status: GOOD ( 15.22 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org During error on CLOSE_INSTANCE command, ctx_work_bits was not getting cleared. During consequent mfc execution NULL pointer dereferencing of this context led to kernel panic. This patch fixes this issue by making sure to clear ctx_work_bits always. Fixes: 818cd91ab8c6e ("[media] s5p-mfc: Extract open/close MFC instance commands) Cc: stable@vger.kernel.org Cc: linux-fsd@tesla.com Signed-off-by: Smitha T Murthy --- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c index 72d70984e99a..6d3c92045c05 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc_ctrl.c @@ -468,8 +468,10 @@ void s5p_mfc_close_mfc_inst(struct s5p_mfc_dev *dev, struct s5p_mfc_ctx *ctx) s5p_mfc_hw_call(dev->mfc_ops, try_run, dev); /* Wait until instance is returned or timeout occurred */ if (s5p_mfc_wait_for_done_ctx(ctx, - S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0)) + S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET, 0)){ + clear_work_bit_irqsave(ctx); mfc_err("Err returning instance\n"); + } /* Free resources */ s5p_mfc_hw_call(dev->mfc_ops, release_codec_buffers, ctx);