From patchwork Thu Apr 11 16:03:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10896369 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 B61D21390 for ; Thu, 11 Apr 2019 16:04:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A106B285AA for ; Thu, 11 Apr 2019 16:04:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9344828B58; Thu, 11 Apr 2019 16:04:07 +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 2117928AF8 for ; Thu, 11 Apr 2019 16:04:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 84A4F898F1; Thu, 11 Apr 2019 16:04:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700042.outbound.protection.outlook.com [40.107.70.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 084A0898F0; Thu, 11 Apr 2019 16:04:04 +0000 (UTC) Received: from SN1PR12CA0089.namprd12.prod.outlook.com (2603:10b6:802:21::24) by BYAPR12MB3463.namprd12.prod.outlook.com (2603:10b6:a03:ad::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.16; Thu, 11 Apr 2019 16:04:01 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by SN1PR12CA0089.outlook.office365.com (2603:10b6:802:21::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.16 via Frontend Transport; Thu, 11 Apr 2019 16:04:01 +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 CO1NAM03FT015.mail.protection.outlook.com (10.152.80.167) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Thu, 11 Apr 2019 16:04:01 +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; Thu, 11 Apr 2019 11:03:58 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH 2/4] drm/sched: Keep s_fence->parent pointer Date: Thu, 11 Apr 2019 12:03:42 -0400 Message-ID: <1554998624-25799-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554998624-25799-1-git-send-email-andrey.grodzovsky@amd.com> References: <1554998624-25799-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)(376002)(396003)(346002)(2980300002)(428003)(189003)(199004)(186003)(26005)(316002)(68736007)(16586007)(97736004)(81156014)(86362001)(44832011)(104016004)(486006)(77096007)(105586002)(8936002)(76176011)(2201001)(8676002)(36756003)(14444005)(7696005)(6666004)(50226002)(51416003)(4326008)(356004)(54906003)(110136005)(72206003)(426003)(53936002)(336012)(5660300002)(53416004)(305945005)(50466002)(478600001)(48376002)(2906002)(106466001)(81166006)(446003)(11346002)(126002)(47776003)(476003)(2616005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR12MB3463; 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: cfc2c2a6-2aae-41c5-3251-08d6be97501f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328); SRVR:BYAPR12MB3463; X-MS-TrafficTypeDiagnostic: BYAPR12MB3463: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00046D390F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: jefD4jMY8G6DNb84GtCZLziovGIzyJ7etWIUbDQD/7YDsrJs0W+IYagP4jaHysX0DKVQECYGtDrmHLSrDmg8ZqmvhB0Te12ho1Z0s4fMWJbZPwBpORGI2glhyVRoVFeGRlVtGlC+5vRuyhhBhGluddz3rPSe0eKiAYsR1PWeCgvvRoyTOeXOrvTKYhDmeWf9jmI5wDcst8wlZh/XFc4k89Mz8mtLm/2tN7+or+p9Ieqi2JXpFmxxyFicaNtKpMZ0IwL5ab+9GOCuvoBXLB1Lh2SfSrVe2+MyW4L0vJo0fyalyAd+82FxCX401BytnC7JPeE14u3da5kcc/eti2WWYr96DiFRUaZ/4sZQQ5HnBx8wgoTsFiN/ToqodxDEQnGU1LnZExjC8iRvklKJKYk2V+JFvJP/D5244ir+3euW1gs= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2019 16:04:01.0722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfc2c2a6-2aae-41c5-3251-08d6be97501f 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: BYAPR12MB3463 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=2WzipMdxl76BSrvQ1+h6v2X3RxYJm/Rq/8YhlkEfktU=; b=hkU/YXkuBDA2CkjR5tTrkJhXRgvWqdLlMNljfv2cPUoSAgB8CmctR4L3wxPncvsaapUvwxYdcQk8Hyoz9WsNEDrlFg0jYna1ci3Pd3VRg4nF7twulmdDWSapzPuyvuBLSBctEbw7VaFlusRB8fQMe2n0mxs6Kpwo8uq8GrYT20A= 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: Nicholas.Kazlauskas@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. v2: Move parent fence put to resubmit jobs. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/sched_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 05a4540..89d1f1b 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -368,8 +368,6 @@ void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad) if (s_job->s_fence->parent && 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 { /* @@ -396,6 +394,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); @@ -467,6 +473,7 @@ void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched) if (found_guilty && s_job->s_fence->scheduled.context == guilty_context) dma_fence_set_error(&s_fence->finished, -ECANCELED); + dma_fence_put(s_job->s_fence->parent); s_job->s_fence->parent = sched->ops->run_job(s_job); atomic_inc(&sched->hw_rq_count); }