Message ID | 20221121063407.7770-1-ming.qian@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 A6D63C433FE for <linux-arm-kernel@archiver.kernel.org>; Mon, 21 Nov 2022 06:50:02 +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: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:In-Reply-To:References: List-Owner; bh=VKqD3NiA5HKHfTnFbf6/gBD3orOEHIv5Z1QzadE2MTE=; b=Eo3CA0U8iEDTUX taCScDB6p58vCVpe/pVaAPi8RorAV9mC4TiJb1eFjIB1O2q/6W7IrQghxXsMbaM/Hn9iPMMkoVjcw l/T4slwDGbp3ZquZsnUnQp3V7aIg2iI9B49HseAYClKlAKzcScUbvPHb2+g4rVTLCwgW6SnU+aPTS 98tb3n6Egfaa1PY9ce2TlbpVo8D/Xqy2DayZqWgCljPceH5rjZojQtMNwJjfsH9iVdcXgmhexlHx6 ckd//pXsIZoKSaPA24iePHIQr8CNO7KP9pxceUsVCXw79dOWxGu81ZhLRITdmrfnloNPMgXlf+p20 Aa5tX1gGPpVtuHiO1X2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ox0c2-009zD9-DS; Mon, 21 Nov 2022 06:49:02 +0000 Received: from mail-vi1eur04on062e.outbound.protection.outlook.com ([2a01:111:f400:fe0e::62e] helo=EUR04-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ox0bt-009z9h-UU for linux-arm-kernel@lists.infradead.org; Mon, 21 Nov 2022 06:48:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gtEDrR7eL5UJcS2PYSQSMp1bSHyXUPzfj5gKCvxlNRgautsPGGZ7LLbZfsacCJr9olXrqssNJPU3FiK7cL7UI3zz0nM6ejuWNejx2OJo0HqBHuiTiOGYCXTbGivrN+K9X06cEL4JYedBzmDT0H7pJOlhvipQVQ6Ma+KWdCG3zwCVqcO/VjUU/wq4UT9RLxTZXEFNSL5cZCcpULaJ5BLyAGsI68wnxCaPzNJkFnX4C2ByAG6YWna/z/J4AXHg+YAYODKm57BJrBQfIxOe5EW+oVBmMXe5S3G8Vl93WauLieOg7qA+4Kxng4l2/KC6deWFhwLYkPPWoq4wKK6IFemBGg== 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=JflHKlYZmBKZNnJsTXXhJIB6LzGhT9Y0Ng0hOtUdIo8=; b=lg3GE3YuTETXG+cfk3dhKoAzFAOCIUKiivug13J/S0B7SUoBDCRedCsIc0AcXdQCCTTIPIvHcNNKYpfWnPMi/vnVRRoptS+/r/jy+t55OdcBBs9KZpdybG12Q82J/Fpe6Z1SnFdUfeTZcuCIcGO8QYVtfOHQStCyBlyczLDmrfQXyw9qMcRK6pqD2mKJpE8ayCU03V35e5B75eu0mgauVkJWQCSybDVdFsMUq/pwFnc/Otc7l3kmKooBg4Rt1tDgrp6bdLi025lUj5zGsPZ488sWLRL+hvgmESA06SKIbLH3hGf5l8ApESUPFoqz4bnwNv+QlrUzJY0YJ7lUrl6kpQ== 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=JflHKlYZmBKZNnJsTXXhJIB6LzGhT9Y0Ng0hOtUdIo8=; b=L8KyEfkX6SKC0wbOzx4mR/tQ665DCzQ1PDC7yXZMUZPifluYsFUowZc1bDFy+8Yg5PxHbkRIbBkCnHCfqxSvKNkLhU1ZXJmi90v/cTbQcgTBaCHS6u3FwEaGObrLrVL1nysEq/g2MQ2E8SJXSV37m/5S8S+RSjPbTd7WfBoWL8w= 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 PAXPR04MB8736.eurprd04.prod.outlook.com (2603:10a6:102:20c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Mon, 21 Nov 2022 06:34:24 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::5c78:27ea:319f:d11]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::5c78:27ea:319f:d11%3]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 06:34:24 +0000 From: Ming Qian <ming.qian@nxp.com> To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] media: amphion: cancel vpu before release instance Date: Mon, 21 Nov 2022 14:34:07 +0800 Message-Id: <20221121063407.7770-1-ming.qian@nxp.com> X-Mailer: git-send-email 2.38.1 X-ClientProxiedBy: SI2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:4:186::8) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|PAXPR04MB8736:EE_ X-MS-Office365-Filtering-Correlation-Id: a9a60fd1-fa03-49d9-20de-08dacb8a6e85 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8JjugRWAQMxMYRtoEEpGVMlxaQvqn+XJGA54ThM1KfaYJeQLBbVJYw1UhUPsTsjisY1miXBOIyMVo9MzCYxwelwUkRcjDT/fiWz3Qo4NnoKz7GWmTbv81bX/cM7MXxgbFFNG8BR7Ny1ng4fKSOpqHaDHI+/NtBbi+7LFeYnLMXXWe0qe02TOuMgkiAYAKOyIZoxUcSndCJuevXwabrLwrgYXdmHU3QouoGiM7PiY9CHbDOO6HNjHwg5WJ2CQfqUCtv7EQqDrIiTzB4FBPvMrKsEfdzer1fd058nySETclWaw3+HpNdv2bNtXk6OisWjW/68K9WXTaetUSG0/AXwYF+ZoxiSNmpb/czmmsIjc9zOWJEnxc+TJqpwbUWFXoo2I4LuI8EohYTvvIZrC0zClh6gaipmoW2CGbMPGoHzX2F6eZHVxYDQUZ3FpsNyV754k4AwzA86FL1MAudPuPrdO1vhJ5o7QDc0KmM+HyFec5EC6a4ahMNasfFbs9XQ1cjzkoBwNn60ajGCB2cDNrc/BtrsjIaFT9zXhrmFhz1KtqWYdO890Tk4t6cotmyDlyibrSXGFH2j1P3hMfs40I09W6cKsKYT6oeveH5REZ2K+m7uLEtZRsQukKGZbDZJuXQ+Ymj5iyjGNtd4TaO+Uk2ly0s5Jwa0Vhwsn40kEx/DLPZ/4Sqo2qlcBwsNo64IiVFWefzBPHdpbJD3bf3xSqkZDOQ== 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:(13230022)(4636009)(39860400002)(346002)(366004)(376002)(396003)(136003)(451199015)(5660300002)(44832011)(7416002)(6506007)(316002)(52116002)(66476007)(8676002)(4326008)(66946007)(36756003)(6512007)(41300700001)(2616005)(26005)(1076003)(8936002)(186003)(38350700002)(38100700002)(2906002)(83380400001)(86362001)(66556008)(6666004)(6486002)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yMmqRuUhvND132bILu+UfELstXcupo5kEHtcT3JztXDcnXKFGL8wE5vf/oTkveKtDxOFC5AZezUooBw/0ltYYQpeHjMh2g+TG7JjAY3YebZ+26B5ou3tc24kg16SljcrAxjPSc0qY/07UBoIT2AyM4WvXYzsv1V2/D1UAturYnt5fWLuA8k4M9+czLNlp4JQiMJ2Ojvx7y9DCxoxN3XuDp3DgpMJbDPWXGpDZmv+5ZvrW+/aBHL3IQyy3MjqpSH5sLGtYFoTHFdhKcyE9k3vQ8zjnsF+Y736R4S5SKNFadYyQqnCU0DccSLPwFX5hcfo1M2ZuREn20j7lVVNR6GLMYqCEt72LzACz5py8MeF7sI+rMCR6LANd9gWBw2Lk96chGQVNYBxI6ahGJvsBphzoovlmAaktq0yJz1qVzthY2i5n1zM5ic/McoTIG1r1s772Kl1VoxgD4AoNLmfHOiuHUln0+fLYOH6N3rzrBdKTO9Km/+t2gvhmxPHs/XdtGJyHgHfkkdtnZlpZepZdF585VPVN7MsDhvP7TU2E0bXqsWM/3jo8J2wqvdjNLOGAa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fd1-fa03-49d9-20de-08dacb8a6e85 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 06:34:24.8208 (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: YsL3YeVX0/Whf58b8aBHDDz0CTkIQ5vTf5TUFoRSIR1+4f3fYo+Wu3rHT2BsqVGPYeUfyokgaLcjAU9oRiUg5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8736 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221120_224854_017271_8C7FE10A X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
media: amphion: cancel vpu before release instance
|
expand
|
diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c index 30ce9f06d91e..33aaa86d465f 100644 --- a/drivers/media/platform/amphion/vpu_v4l2.c +++ b/drivers/media/platform/amphion/vpu_v4l2.c @@ -681,10 +681,6 @@ static int vpu_v4l2_release(struct vpu_inst *inst) inst->workqueue = NULL; } - if (inst->fh.m2m_ctx) { - v4l2_m2m_ctx_release(inst->fh.m2m_ctx); - inst->fh.m2m_ctx = NULL; - } v4l2_ctrl_handler_free(&inst->ctrl_handler); mutex_destroy(&inst->lock); v4l2_fh_del(&inst->fh); @@ -767,6 +763,13 @@ int vpu_v4l2_close(struct file *file) vpu_trace(vpu->dev, "tgid = %d, pid = %d, inst = %p\n", inst->tgid, inst->pid, inst); + vpu_inst_lock(inst); + if (inst->fh.m2m_ctx) { + v4l2_m2m_ctx_release(inst->fh.m2m_ctx); + inst->fh.m2m_ctx = NULL; + } + vpu_inst_unlock(inst); + call_void_vop(inst, release); vpu_inst_unregister(inst); vpu_inst_put(inst);
Revert "media: amphion: release m2m ctx when releasing vpu instance" This reverts commit d91d7bc85062309aae6d8064563ddf17947cb6bc. Call v4l2_m2m_ctx_release() to cancel vpu, afterwards release the vpu instance. Fixes: d91d7bc85062 ("media: amphion: release m2m ctx when releasing vpu instance") Signed-off-by: Ming Qian <ming.qian@nxp.com> --- drivers/media/platform/amphion/vpu_v4l2.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)