From patchwork Mon Jul 25 13:40:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Liu X-Patchwork-Id: 9245769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5A08D607D3 for ; Mon, 25 Jul 2016 14:13:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C0CD212D9 for ; Mon, 25 Jul 2016 14:13:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4075A276AE; Mon, 25 Jul 2016 14:13:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57912212D9 for ; Mon, 25 Jul 2016 14:13:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B193E6E37B; Mon, 25 Jul 2016 14:13:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1943 seconds by postgrey-1.35 at gabe; Mon, 25 Jul 2016 14:13:46 UTC Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0066.outbound.protection.outlook.com [104.47.36.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E73A6E37A; Mon, 25 Jul 2016 14:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=q5GiaDWobI8OoUxXnigKtaxaZsAqIt04rDDKWBBiDL4=; b=wfqMtBq6osn8sGYm2PM7OoznQt9Mwil8Q4WyaqjOi28kqKfqN61E0CK7j7OCibb9FwdQGfHORo1Z7uFDRd0l3s2fbIoOgHyk63IfjS3ZJ1kpMB8MISk3ALniEacT1tPBnUTEk74b0hikOL0aHR/KrvDJGfhLDxPRTuLGAWUMbko= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Leo.Liu@amd.com; Received: from ubuntu-desktop.amd.com (165.204.55.251) by BY2PR12MB0055.namprd12.prod.outlook.com (10.160.66.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.544.10; Mon, 25 Jul 2016 13:41:18 +0000 From: Leo Liu To: Subject: [PATCH] drm/amdgpu: free handles after fini the context Date: Mon, 25 Jul 2016 09:40:55 -0400 Message-ID: <1469454055-3634-1-git-send-email-leo.liu@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: BN4PR15CA0032.namprd15.prod.outlook.com (10.164.54.170) To BY2PR12MB0055.namprd12.prod.outlook.com (10.160.66.152) X-MS-Office365-Filtering-Correlation-Id: e9d33c4b-f786-4216-bef7-08d3b4915b5e X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0055; 2:zEXHUYq/zhy5hY0JreNer4pTwmGuLtxwYHe2zrQTGbz5xJrKdP2PEYMXWaeHWfQZ8Cg4poYthVveGYMLqPUJ0NVzuEdcKZ7hKZy94pmi99IQQqsZ0xsiLO0fsl5qg5BA08t9P6n4TidMzwH4GqtGOjjxYmf6gIZx2rNYdAOxwRKZsuR0wJGlDGTMbdI1jM4Y; 3:JRT1ouwg/UtDMVy5AFP+H6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QEdjZkeqx5e/MHUx4CwAiVo/MbCTl1SqmzpyBTIQSzAigMrT8tvHXDmak9u01plxMAjGsZC2zT7qIXhMN9oEa5uSSEnBhlXj4b+1c9fHrYNREuoPAU+Z+/Mm0Hx3tJnT8k4t45gSshU8sdQlSst++SZhQxx3wUoWCLYLv6OSSiPo20VT1yYtezUw1Ytbrg4lMbWO65J1ooMIVvhOkMACuQlVqOpUOc3s8nq3mfzFWHgo6EH7j4d4Pas60rodhGIPLkPNb9Bhllrm2hSJZ; 4:I0o9u0VWrNrL8puidp/ndhNnS1ksR93xx1ZDYmalcDFVdKDzb+yQESks8uEyME1Ht2sIRiEa9c+I+Q8ieZWQ2ghh+euVQknzOx4ChRqgDlLee6habbQn91Q723sKY6cLp3qAhFvh1R1o0rFHASUdlsyAIhHYR2WPjcKXUSmUuQE0suPW/NMFrSB5Bi6GbEtf2zzCSjw2C3tK3vPFKsCACeyDjlh6qIdkIKNhNHH8Xl/jd7eA0G/edmrjqF4l1WpGTsVVTmQ+04ehl75L5sgOnwcdWtUZSSOMTLCCJK6JkxiZ2fhu7mbIS6DSgILf3JcBO2SnT1g7WuFHxHYZEuWADrafvwCFzk/Nn5fXz6ef5d7MhZYDiRLQc2k1P4IWL99rMeNHS/MdzJCPA9O4NpLjzVp8/9A51Efhg/YfMqU4Fao= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:BY2PR12MB0055; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0055; X-Forefront-PRVS: 0014E2CF50 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(189002)(66066001)(19580395003)(5003940100001)(229853001)(19580405001)(106356001)(105586002)(2351001)(7736002)(305945005)(7846002)(33646002)(450100001)(47776003)(50986999)(36756003)(53416004)(77096005)(97736004)(110136002)(48376002)(50466002)(189998001)(586003)(3846002)(6116002)(50226002)(4326007)(2906002)(68736007)(42186005)(92566002)(101416001)(81166006)(81156014)(8676002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0055; H:ubuntu-desktop.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR12MB0055; 23:J0cM91ql2J3NZUvnUxfz5VPxApz9DeNUk9QElAV/j?= =?us-ascii?Q?Rlp9QnMqEHweFm+ghLs1YV5Ttb5qNd0d9ah4lJ9uLemCFldd42gZzeMHJ+jS?= =?us-ascii?Q?Ru6xfwpu7aw1qg6S5FhsEUFjfvlNA3Hj1OtHwHW0anw2hPo9pfVZwHckvY7B?= =?us-ascii?Q?LsyfrDimXtIp6NdKj0QryYjUmAcs6+vyldQFkSm5DrRh6kttwvlaguKVlo2+?= =?us-ascii?Q?k2t1rHS+p4+EOM++KVlM3EC9YgiNbPIlBVTQ81PAJrTW6wnO2ySveFY1hKTa?= =?us-ascii?Q?9OIYaYcqc/CXFa7L5ayZId/OQkaalnoGZjL+jTN1cIkOdiVrScyCFfD/fiH8?= =?us-ascii?Q?69ajSCDMLfTxNp+DylH2yypzkqk2M9mg+dB5ut9mMxLhYzF9CP1W4i6P3y+J?= =?us-ascii?Q?AmWoa+3SuURWCZ31K8YmOCDkiJkxfob4TM4vCrFLtb+ACbtQsZahe0f2DwAp?= =?us-ascii?Q?K4ZvYi31tke8x4Y7Udf4unSjru/YblBiPLRuXR/EALsoKpRUifzln0YSZnTl?= =?us-ascii?Q?v9HkhSL1bhIHw6Rk9skUXrC9ofsAC0ciFQgzypyGmNbYZT3Qlx21yXsxFPle?= =?us-ascii?Q?aPlfKTUAvjs68Iw3Y7kNaCcphF1UF46Kqqyo/wdGZhL2gvc1ve53oo3NlcfK?= =?us-ascii?Q?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q==; 24:77L60Mh7epsxOIpEz8K02oW4HEFoi4+o/2Nu8o/KzQ4Jnc6sIbgA4qoQH91bc+44ZXcuUd2O+eKzH6Ly5cxzg0RA1mVe+sq93RoyCnLfV6A=; 7:Exmlj4ej5TFpzpoe48XRnPrL6eLChO5QECCNwcKwgOX/aylkrhm8ljFiG4xlNwf3z/llq99FwBmfvpfSoWh5EOd1PCDq8wp2zlof2rsHjOVbOOnhJ7vTdZLFrG5nilS7FdwrY7tZWQAEdgi0Jbqo1Rbgh1ZWbiNYrLW21JJkltCFFWsAc9hWDp6THz4aHMXaJdq+RLWjrSvuU6/jampBVqIw1aFYReue331BzqQnKe2W+tdPssXmXPGZrf/jeE7E SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0055; 20:JH+vTkxqMMhW/x8McYUHLbm1yO6sc5Q4vAr7oqQIv7CxnFwilMSV/sXnbhME4YLKGS0N5m4Jai/N8re72xhTCHk7Fxief3lhRKM4l7gyb5PB6VopDHt0YqolCt9N4npg5J0ZwAXz6Axw9dhppoA+XuuFT9t/5QrK+4IJVKWNQldoyyKJkyBkXFN2R2huaHQZALmvWVjt1eyqkyLDQdJdPffBPS7YQUOAbo08IJmcOkDjHyZELCeSmhJPC6AjbHHr X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2016 13:41:18.1001 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0055 Cc: Leo Liu , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This will make sure all the submissions from different contexts gets finished, and then we close the session and free up the handles. This will fix the issue that session clean-up is not get done properly, when with the command `kill -9' Signed-off-by: Leo Liu Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 29bfd4c..0fb5488 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -578,6 +578,9 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, amdgpu_ctx_mgr_fini(&fpriv->ctx_mgr); + amdgpu_uvd_free_handles(adev, file_priv); + amdgpu_vce_free_handles(adev, file_priv); + amdgpu_vm_fini(adev, &fpriv->vm); idr_for_each_entry(&fpriv->bo_list_handles, list, handle) @@ -602,10 +605,6 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, void amdgpu_driver_preclose_kms(struct drm_device *dev, struct drm_file *file_priv) { - struct amdgpu_device *adev = dev->dev_private; - - amdgpu_uvd_free_handles(adev, file_priv); - amdgpu_vce_free_handles(adev, file_priv); } /*