From patchwork Mon Apr 8 16:08:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10889815 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E1551708 for ; Mon, 8 Apr 2019 16:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8913D286E2 for ; Mon, 8 Apr 2019 16:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DE91286F6; Mon, 8 Apr 2019 16:08:49 +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.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 329EE286E2 for ; Mon, 8 Apr 2019 16:08:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59CD4892B4; Mon, 8 Apr 2019 16:08:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0631.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe45::631]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A18A892B5; Mon, 8 Apr 2019 16:08:47 +0000 (UTC) Received: from BN6PR12CA0026.namprd12.prod.outlook.com (10.160.47.12) by SN1PR12MB0592.namprd12.prod.outlook.com (10.163.208.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.19; Mon, 8 Apr 2019 16:08:45 +0000 Received: from BY2NAM03FT051.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::205) by BN6PR12CA0026.outlook.office365.com (2603:10b6:405:70::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Mon, 8 Apr 2019 16:08:45 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by BY2NAM03FT051.mail.protection.outlook.com (10.152.85.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Mon, 8 Apr 2019 16:08:44 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Mon, 8 Apr 2019 11:08:34 -0500 From: Andrey Grodzovsky To: , , , Subject: [PATCH 2/3] drm/sched: Keep s_fence->parent pointer Date: Mon, 8 Apr 2019 12:08:11 -0400 Message-ID: <1554739692-6999-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554739692-6999-1-git-send-email-andrey.grodzovsky@amd.com> References: <1554739692-6999-1-git-send-email-andrey.grodzovsky@amd.com> 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)(136003)(39860400002)(396003)(376002)(346002)(2980300002)(428003)(189003)(199004)(106466001)(5660300002)(305945005)(36756003)(54906003)(110136005)(47776003)(68736007)(316002)(16586007)(105586002)(4326008)(81156014)(72206003)(81166006)(48376002)(50466002)(8676002)(104016004)(53416004)(486006)(8936002)(2906002)(446003)(186003)(6666004)(356004)(97736004)(51416003)(86362001)(7696005)(14444005)(77096007)(476003)(126002)(53936002)(478600001)(76176011)(26005)(426003)(50226002)(336012)(44832011)(11346002)(2201001)(2616005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0592; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4121528c-edc3-4510-b339-08d6bc3c79ed X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328); SRVR:SN1PR12MB0592; X-MS-TrafficTypeDiagnostic: SN1PR12MB0592: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0001227049 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: O+ZwCUX470A5A9f2GyDv0UneRqhrwKOMjd4wUsQCD7J+IY1eA5RXkEFhXRztth2rpURSqLwGzjVBfnvBZt4Jy1YT1PXnDApe/rcso8HebQpUETgHlpulMn1/eKqQZrjHzCYADTz3ZKr/yTwYvmN5X0NfFQjdm6SU+xFIiBBiP3iL5xRL5hp8HrMUjuO7Y+zd10cbLGdGYrleIzNQ3ckS46YEx22efE2ZW6fyA7lPu10NL7TmgJDoD96y++mO18p8PL/Ki3jImIUpiBzpIsMcj5/cKTCWH/zUBAY6Mt8YShcFsgLnMEOH/O+zHufOdaSldpu+IWc0rHNVx9BgL+LoNiX23W2QAzZW9OMGf4WMjJZnMs/9Vfj9ItIwLWuRwWjq71zWzgms74SQZvOhalyhSSZdRy4zkTFIQ91e6eIiJ6g= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2019 16:08:44.7243 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4121528c-edc3-4510-b339-08d6bc3c79ed 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0592 X-Mailman-Original-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=hyuhjKQ3DZ/dlI6ssonzMJvtSYuvLkZZwnTMbTlUK0w=; b=4KJ8OHzs2KF9ApWVWrFkampjNgq5bto30UuTOkYL60imIMbT3uhs75GTUeLfhQqViBZ9BmYqz8Yo7eNX/jFG/HxAMyc32VfmDYZ3c/HhEb2Y+mcboEZg86VAwO5OZGVBx5oAIvgC73ahBpf6xJvr7yNAm2zZAlnyxFHsUNoWMxY= X-Mailman-Original-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; 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 For later driver's reference to see if the fence is signaled. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/sched_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index c215cde..5bb4368 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -191,8 +191,6 @@ EXPORT_SYMBOL(drm_sched_dependency_optimized); */ static void drm_sched_start_timeout(struct drm_gpu_scheduler *sched) { - unsigned long flags; - if (sched->timeout != MAX_SCHEDULE_TIMEOUT && !list_empty(&sched->ring_mirror_list)) schedule_delayed_work(&sched->work_tdr, sched->timeout); @@ -371,7 +369,6 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad) dma_fence_remove_callback(s_job->s_fence->parent, &s_job->cb)) { dma_fence_put(s_job->s_fence->parent); - s_job->s_fence->parent = NULL; atomic_dec(&sched->hw_rq_count); } else { /* @@ -398,6 +395,14 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad) sched->ops->free_job(s_job); } } + + /* + * Stop pending timer in flight as we rearm it in drm_sched_start. This + * avoids the pending timeout work in progress to fire right away after + * this TDR finished and before the newly restarted jobs had a + * chance to complete. + */ + cancel_delayed_work(&sched->work_tdr); } EXPORT_SYMBOL(drm_sched_stop);