From patchwork Tue May 15 19:31:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10401813 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 D62E0600F4 for ; Tue, 15 May 2018 19:33:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C597D27F17 for ; Tue, 15 May 2018 19:33:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA1BB28358; Tue, 15 May 2018 19:33:42 +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=-5.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 12EA827F17 for ; Tue, 15 May 2018 19:33:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D6AD6E2BF; Tue, 15 May 2018 19:33:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0081.outbound.protection.outlook.com [104.47.36.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4788D6E2BF; Tue, 15 May 2018 19:33:40 +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:X-MS-Exchange-SenderADCheck; bh=4eImSzmiRs8IppO/tISmjGErswHS8VPqIwnF7rP96AY=; b=2AW0i6U7vTECMn92P7in3dA8glkH0FkFFhrx6TlXQX2bLQxz+VIpYwf1KzA+dGBM5pxE27vFO2e93lTepuf45AzUCSnMlfPegJO0urpzkeITp8+164aTzgODco8XcsD4QYcqYoajP9hMdsrI7VwgweYqQgnvbSqpVuCuWelNO0I= Received: from DM5PR12CA0003.namprd12.prod.outlook.com (2603:10b6:4:1::13) by BN4PR12MB0755.namprd12.prod.outlook.com (2a01:111:e400:59bc::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.776.11; Tue, 15 May 2018 19:33:37 +0000 Received: from BY2NAM03FT031.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::204) by DM5PR12CA0003.outlook.office365.com (2603:10b6:4:1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.776.11 via Frontend Transport; Tue, 15 May 2018 19:33:37 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by BY2NAM03FT031.mail.protection.outlook.com (10.152.84.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.755.15 via Frontend Transport; Tue, 15 May 2018 19:33:36 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Tue, 15 May 2018 14:31:21 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 1/2] drm/amdgpu: Skip drm_sched_entity realted ops for KIQ ring. Date: Tue, 15 May 2018 15:31:13 -0400 Message-ID: <1526412674-15913-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(376002)(39380400002)(2980300002)(428003)(189003)(199004)(5660300001)(104016004)(6666003)(53416004)(2906002)(47776003)(105586002)(106466001)(97736004)(36756003)(478600001)(50466002)(48376002)(81166006)(450100002)(68736007)(8676002)(81156014)(53936002)(8936002)(305945005)(356003)(72206003)(50226002)(4326008)(86362001)(110136005)(186003)(426003)(54906003)(316002)(16586007)(486006)(2616005)(26005)(77096007)(336012)(44832011)(476003)(126002)(7696005)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0755; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT031; 1:bgY4/ZvTuo1nTwNSAF5OYToJqK7rBEs8jhg7P/PYKeRMfIYRs+veQN46eRE7v9hb+miwZEz8TzIof36bYHEfjExT0VyE1qAUsYAqO39X7fBM/Sv7FsVRfkv0j4AOXnH7 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN4PR12MB0755; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0755; 3:zOiY2bByAaRI64KnBC77T/gzHMcVL5Y8/H3fi7oqJva/kjTqwHqzykl3tlsRgd9VVUHTaiJ6uKPV4etS988XBHZ/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CG90qb8FRt4Qbeow7ZUPIO8Dcshji7MDaCpgZkxBn7xEECFF4/pPBTH/gsEsl3uXa/ZdHPEOrXZT7jqfL6IHmaqWjq5wyGcyidxE6bRSKFAQquI/Ql4L3Gq8z0jf/MdLoWLsTLeLld4jNtQYZIPua37LFiPdYXHq7MJ8LkbUfk/LzUeH0dPgtpvd3DKX1fjYGTCbO0LzyyoU6qYK8rNX0joOPvm6PiLbPuKO+MbMcyawUjP9CZ7tzhT//KRl5PvzGa2S46rrdaehIV8mL3eyIP1G/C2yAQaYu8cFqTvilmQha07V6wUpjVg+u5iFVBNGg/rkPl3IXxJuPs4PjsIrsndEoUhWPnoPINDO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93003095)(3002001)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BN4PR12MB0755; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0755; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0755; 4:hiLsebzl0guKGGwg3NmZ2UvwrblHu3Cf4LL2J0d/YvG7U69jr4mRxg++1Q4myV4ThKnbIiiA7vwXd6mNU13AT12Amg85//DNwSP1tj1iMoUiaLI0WpzoMxlfjmDKF8JNQAIPmslPs7YHBjshD80Do56lMR/o498uTLeghsQap3Hlln1VS72QkENeNIUGO9aG7fUkEX61IsPh8uw2ljULszmF3t5q8mvPbYVbmFJ9S1xBwpi3v+B349cyxrZGIxHPPqe6JdfKeMumbQzuLSDrQc8cuvMeN34/3ND+yQ9O1v9ZuyaksKmHKy4+zBJSIEkc X-Forefront-PRVS: 0673F5BE31 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0755; 23:Zxd02p0JAnqSSwOiAlSGy6UHPM/EgIuDSj/33gV+Q?= =?us-ascii?Q?lDo6PTpklXnB/VrXk9OPUW77FCjKnu07hu8jdUp8TkhMY34IF/ZDK0dtAPQj?= =?us-ascii?Q?0AG1Hqke4Az+TkRW4GtETgV5Ry5gfCSf7qGG4mxjsBQHzCGQeDOGNisQ3U5p?= =?us-ascii?Q?75F9gO+3VSV4S2Zn1unA92qjBA+J/vyjkKLELfBWwJEfpz2xDLIiiDsJllCw?= =?us-ascii?Q?O/sJgqnqckhOWxgjnQZxwn4xZQv173yMUcjUUiySFeikMr7RBy+1JpMZKytc?= =?us-ascii?Q?Q0b9O3V8ZN47Ld7lE72d2dv2tC55Q1iSyj9vIXTrW3y80Hmd39UdTgwTk1Fx?= =?us-ascii?Q?2pUEhZKm3beDVzxOsF2PalN1edcXEyui07DyexUCLeST49RH4JwErKGIge89?= =?us-ascii?Q?ISSafej5/hxvTrBlDE1d7/lfus2H4Tu8tm5qa3pHHQSErJYutHbT3Wo5zOZq?= =?us-ascii?Q?iyfnSHVbsKk/dlcyZvHWUCvHzJ44RcxVRFBlbFsEWBvFxwmK2545U/K9OK5J?= =?us-ascii?Q?EGcz7qH6nX5ZaCj9n7CJ6hMJrF3UCBpgWyZ7qhI71mNW4dLu3mgByRaFCWYY?= =?us-ascii?Q?5qBkXv1sFqEHPSEXTRe3PUoH4cqkRJSAFGBX+bIYE+XizG07FjFol2v/O/pn?= =?us-ascii?Q?AVGnhYVwR0K0O7LPDfExu/tJ2CZiHxDy54L16AddYDlB0F2EnwSZf01AKXFd?= =?us-ascii?Q?vKxrp1Zy5R2eniTQhh+tSNHiASut9355GBVQGU2h81n8S7UZHp0mvtnaJg38?= =?us-ascii?Q?8QatxMK9kAwit6//Datqd+iqnIzdjEQltDvJjrOvvraJdo5UWU8jHFkIcW5u?= =?us-ascii?Q?HXoZZeAtzsCdy+1snsjaM8z9rG8MeVWX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cGBSS90rtYys8G1OQIBNsTVLHRhVHE0zSrc+ycvBn27tVwri+g==; 5:Q2K8dyFCcO3DhRZvGfhk/tC0j28ZpAdUgAys0b0aPrAMiYeUOjUfNaWSXgedqMFd2MocZBcKZT7qYQ57ja49y8EKeFDb39Y+sdZPQ0ugj8PgnJtSpVdLyZwOO2k1YqwrYIRDgOEZfCQEmkG9RLYg/sEePmNpPc+aIE2R50+OPuM=; 24:Kbj/DFgSUuMAPdWlIf4KFR2GoH3i0OLwH8+TVbTgCmJdzIFBSprcgqktU8OmUbWqtnjvkOijGiRe85Sby53xORv8XtQ6l6Wn6BF88uIqpHY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0755; 7:RVvtavWVBO9PKUaLyd4wChwNUtUs/v/Y/Tqk7o35vrZhU3ETzl2D8Wyrd3OLG9EmjSdl6WlaVNS3iVg0tfFN0pbY0jsJimjNRTntOsjY6lJDN3S3kWuDuca0vr8HaRk7NIktQMHkgtYnUjxArW+FP2ATZRZ0XwlsFIFrqUWkEvYjcCq+aYdOMGVexpE8XdUZXXvpGu8QmvW3WZC8qxawR6wi5kJ2eDyYDhE7tWQi8RsF6Crhfw753mnZhsF/DJUf; 20:RFlV85VfcdcVAI5BFa8JwHw+p7AewGr9n+yp5obr6TcVSC7M9sQBhY8ckLhaMvc+yHJqUsnU/M97c366pqj+255Us79DUP112BhjSuseJWwGmErvMKI3g3WMskjNun9lPCjOAH0jhWDoVofwCxHXZdrIOisC9Z2zj0Q+Yxet2keXUFFeZSV2ZC949eSPWbNV/+Wp2nses9wZ/ExOALusaJ78QMAmQeWLNFXdQgBcJQwAk7arVlx5wnt1R5+Mf3Wl X-MS-Office365-Filtering-Correlation-Id: d2ac54c5-9a22-4208-c0c8-08d5ba9ac12b X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2018 19:33:36.9205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2ac54c5-9a22-4208-c0c8-08d5ba9ac12b 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0755 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian.Koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Follwoing change 75fbed2 we need to skip KIQ ring when iterating amdgpu_ctx's scheduler entites. Signed-off-by: Andrey Grodzovsky Reviewed-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 6741a62..744519b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -173,9 +173,14 @@ static void amdgpu_ctx_do_release(struct kref *ref) ctx = container_of(ref, struct amdgpu_ctx, refcount); - for (i = 0; i < ctx->adev->num_rings; i++) + for (i = 0; i < ctx->adev->num_rings; i++) { + + if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) + continue; + drm_sched_entity_fini(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity); + } amdgpu_ctx_fini(ref); } @@ -452,12 +457,17 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr) if (!ctx->adev) return; - for (i = 0; i < ctx->adev->num_rings; i++) + for (i = 0; i < ctx->adev->num_rings; i++) { + + if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) + continue; + if (kref_read(&ctx->refcount) == 1) drm_sched_entity_do_release(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity); else DRM_ERROR("ctx %p is still alive\n", ctx); + } } } @@ -474,12 +484,17 @@ void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr) if (!ctx->adev) return; - for (i = 0; i < ctx->adev->num_rings; i++) + for (i = 0; i < ctx->adev->num_rings; i++) { + + if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) + continue; + if (kref_read(&ctx->refcount) == 1) drm_sched_entity_cleanup(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity); else DRM_ERROR("ctx %p is still alive\n", ctx); + } } }