Message ID | 20241204213729.3113941-3-lizhi.hou@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 C29E4E7716F for <dri-devel@archiver.kernel.org>; Wed, 4 Dec 2024 21:38:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5581210E596; Wed, 4 Dec 2024 21:38:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="vXlKGLrO"; dkim-atps=neutral Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2076.outbound.protection.outlook.com [40.107.94.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6E0E10E595 for <dri-devel@lists.freedesktop.org>; Wed, 4 Dec 2024 21:38:44 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hAghY6XTEwmchuKOqaanEzA9rTfaCLerWFuGQwATDRLBPOUoE/DrvWMG+L+/hhyZDHqCiWzF0aEp9u/JTJ+/1SGe/MTTawUSoJubm5M+m5eObOPqvwuiLm2IXs+E7LSMI0B83m0pN278qYeuaSE5hsFzXDMH4QepqWEEvCm2n94HFBlRoA9RzmvGBwdDfRAdZ57j77FAgAhjILLqmsxRbbyhU2ZY7bYihnwD2X0QQVsNpgyzjxV63V/SAeEZ5VqMI0SM1t7b0ykG1gFdvgdS1oK8hJ/0YhkvH4E6//qSVYoOruYoldZcX87ZOj5JzG/7SjnLNIFAWpL/6WbnOZpq1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=IoSjCcvQNLeUIjyTveH7rOTdYtbr6zgdXLFWBdJY+Ho=; b=idBv70RDampUSoABECw17Uhc5qiCH9oA6T00y5puKnZjvAy0I+McdU9jU6BCGx987TI9jwvkEdPxd0ikakvXJgNeRcSzb1Sr1/wqTPW/ICM6fc0K8A2HsPf+s4ElFF9D3kLQFLJmQwjxan1LsAvC5cd7q7PiXWaMWLPfNONhYM6r3LkkT38WebBRCOkZazR9AprGjQ/x36HgVgL3K9tG6ljgpxO8TncAc3mActYp44CVIt480naG8co2CcCknYWXap2/m8jASXTzKg9p0y1SBcFPrIKBFZ92u5RWxRDjcsFP8FbMKrXo0CkdHcgAbk2Hj0MPlsFhUyFB3zmbsmk0zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IoSjCcvQNLeUIjyTveH7rOTdYtbr6zgdXLFWBdJY+Ho=; b=vXlKGLrOFYXXyF2Zl9c8RqeCt3gPIgw8GDkpihsejBj5p5rMSuH55onPPM/Ust4l8isAwk/fZR+9UGQr2yA1vn3TBZ6Z4zCplxfom1le1//7xAhx5667m5h+6837ppisfgCNKH2aWgaF0b/g1LxRqGf07OHbBGSZZQiwbNBzJXQ= Received: from CH5PR03CA0013.namprd03.prod.outlook.com (2603:10b6:610:1f1::11) by MW4PR12MB6684.namprd12.prod.outlook.com (2603:10b6:303:1ee::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.18; Wed, 4 Dec 2024 21:38:41 +0000 Received: from CH3PEPF00000009.namprd04.prod.outlook.com (2603:10b6:610:1f1:cafe::f6) by CH5PR03CA0013.outlook.office365.com (2603:10b6:610:1f1::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8207.18 via Frontend Transport; Wed, 4 Dec 2024 21:38:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CH3PEPF00000009.mail.protection.outlook.com (10.167.244.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8230.7 via Frontend Transport; Wed, 4 Dec 2024 21:38:40 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 4 Dec 2024 15:38:39 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 4 Dec 2024 15:38:39 -0600 Received: from xsjlizhih51.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 4 Dec 2024 15:38:38 -0600 From: Lizhi Hou <lizhi.hou@amd.com> To: <ogabbay@kernel.org>, <quic_jhugo@quicinc.com>, <dri-devel@lists.freedesktop.org> CC: Lizhi Hou <lizhi.hou@amd.com>, <linux-kernel@vger.kernel.org>, <min.ma@amd.com>, <max.zhen@amd.com>, <sonal.santan@amd.com>, <king.tam@amd.com>, <mario.limonciello@amd.com> Subject: [PATCH V1 2/7] accel/amdxdna: Replace mmput with mmput_async to avoid dead lock Date: Wed, 4 Dec 2024 13:37:24 -0800 Message-ID: <20241204213729.3113941-3-lizhi.hou@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241204213729.3113941-1-lizhi.hou@amd.com> References: <20241204213729.3113941-1-lizhi.hou@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Received-SPF: None (SATLEXMB05.amd.com: lizhi.hou@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PEPF00000009:EE_|MW4PR12MB6684:EE_ X-MS-Office365-Filtering-Correlation-Id: 45838a27-bce6-4809-edf8-08dd14ac04f0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: F6LT9I4FSvtf89ely9AmmEOVI1joT7uy/bZvzGkNFqdv5ylDywZQzrtGjLYu3sqy1WmjhvKLIbTtBA5vNwo3X6ks7eB5+7BKbviOvfd0OY+wom3+FyU7bGq8eBPbqjyHvaNhDJNddyGQWlN92TYvR4JTtEpMjJRVoQE2P7Zl1DN1AYIbA3YdwVyw0Qym1TjyQsM9kM/abK1yJIqrLN6GM9vCY/6oHrmSNlKxmKUJnPsoQvq7LS31sYv0tsHIkDIPK+3cuuzRO3zz/uff8/Ri93ZZxowklxEGfhJYwtBf5jznQvbT3HBs2DP5FdA3F3/KYfIWE+DblNUGVF1PKzazJmGx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VkzFyr6Ih88nGvplsAFP4TGQ63XMtx6GWt/RH/2owyJn40honXP1XLp9APuSsBnKwn1qth9 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 21:38:40.5526 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45838a27-bce6-4809-edf8-08dd14ac04f0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH3PEPF00000009.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6684 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
AMD NPU driver improvements
|
expand
|
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c index 90e8d87666a9..b5282555bbf2 100644 --- a/drivers/accel/amdxdna/aie2_ctx.c +++ b/drivers/accel/amdxdna/aie2_ctx.c @@ -179,7 +179,7 @@ aie2_sched_notify(struct amdxdna_sched_job *job) up(&job->hwctx->priv->job_sem); job->job_done = true; dma_fence_put(fence); - mmput(job->mm); + mmput_async(job->mm); aie2_job_put(job); }
Hardware mailbox message receiving handler calls mmput to release the process mm. If the process has already exited, the mmput here may call mmu notifier handler, amdxdna_hmm_invalidate, which will cause a dead lock. Using mmput_async instead prevents this dead lock. Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> --- drivers/accel/amdxdna/aie2_ctx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)