From patchwork Mon Apr 15 19:43:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10901475 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 93858139A for ; Mon, 15 Apr 2019 19:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B41928867 for ; Mon, 15 Apr 2019 19:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F27628942; Mon, 15 Apr 2019 19:43:44 +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 26EC028931 for ; Mon, 15 Apr 2019 19:43:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C44CF894DE; Mon, 15 Apr 2019 19:43:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680083.outbound.protection.outlook.com [40.107.68.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2FA68936E; Mon, 15 Apr 2019 19:43:41 +0000 (UTC) Received: from MWHPR1201CA0015.namprd12.prod.outlook.com (2603:10b6:301:4a::25) by CY1PR12MB0588.namprd12.prod.outlook.com (2a01:111:e400:c439::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Mon, 15 Apr 2019 19:43:39 +0000 Received: from CO1NAM03FT064.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by MWHPR1201CA0015.outlook.office365.com (2603:10b6:301:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.14 via Frontend Transport; Mon, 15 Apr 2019 19:43:39 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT064.mail.protection.outlook.com (10.152.81.77) 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, 15 Apr 2019 19:43:38 +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.389.1; Mon, 15 Apr 2019 14:43:37 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH v3 2/5] drm/sched: Keep s_fence->parent pointer Date: Mon, 15 Apr 2019 15:43:20 -0400 Message-ID: <1555357403-30813-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555357403-30813-1-git-send-email-andrey.grodzovsky@amd.com> References: <1555357403-30813-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)(396003)(346002)(39860400002)(376002)(2980300002)(428003)(189003)(199004)(97736004)(106466001)(53416004)(72206003)(44832011)(8676002)(105586002)(5820100001)(126002)(47776003)(478600001)(86362001)(486006)(53936002)(2906002)(2201001)(305945005)(36756003)(26005)(426003)(77096007)(81156014)(186003)(7696005)(23676004)(336012)(68736007)(8936002)(50226002)(4326008)(446003)(476003)(104016004)(76176011)(11346002)(2616005)(66574012)(356004)(6666004)(50466002)(110136005)(5660300002)(316002)(2870700001)(54906003)(81166006)(14444005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0588; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8acadd27-1676-4370-c808-08d6c1daa868 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:CY1PR12MB0588; X-MS-TrafficTypeDiagnostic: CY1PR12MB0588: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 000800954F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: u505bokm5kXqTD+nr3sZKtSPdeLZfr1cZt1waCy6ITF4VWvlTwaEEZ+ZnF5iXojs4e32M7de1MsVu/B7aPV3xHBwJ+QRl8JMd2g3m6jsgxsE+GfAwxd9OXIHzDnF6Xbm3gDuMJvUS01paxF7ItSu4YybSQGiOoX/Exfa+Jghz+DAdPYIpJvqR1uyRwRUbGcOKYrt2xVlhH+/ppl4BtnP996urPPBiLIE6tcjiyZHgQw0I4NlO3Px2+E/4jnkxAebNFitYNkovk++H02GxTtQl/ISVSulPSOQnvoubBFM11WebODtEWbg+Uiwb4Rdf6ORpFZlVeVgrWndAjV4Sn5/8JfIL95gTFnPMx38dTX2EfDklHM7fDGpOA4NVQAFGrayTiRLLUwVlTT65Yl94w55sOM0gPntjCAGP5svxCXwXaE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2019 19:43:38.8651 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8acadd27-1676-4370-c808-08d6c1daa868 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: CY1PR12MB0588 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=WFo0C1mHqHgngrLU6ixTIoBCvO+NsnrYdAv6OuPwvwI=; b=JOOWTqS38iYdSg8SGLz4tnTvL8iPHtp9/vCUTaAMzXlDUd83vzAzCkDJQ/hkazJuvWiLwiWEENBk23mgQOZq6ENm3pbhg5YBs2GgBCrd12ALhSWPNLKPbljyBf8Ecg6GhdyXLYRHEyoLFmjqThmO8hSUH/OKVI0AHr9+a9FlrcU= 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 Reviewed-by: Christian König --- 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); }