From patchwork Thu Apr 18 15:00:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10907493 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 5ACFB922 for ; Thu, 18 Apr 2019 15:00:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42E5928B97 for ; Thu, 18 Apr 2019 15:00:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 411D628D08; Thu, 18 Apr 2019 15:00:59 +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 C5E2C28B97 for ; Thu, 18 Apr 2019 15:00:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A12F6E166; Thu, 18 Apr 2019 15:00:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710084.outbound.protection.outlook.com [40.107.71.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 272706E15D; Thu, 18 Apr 2019 15:00:56 +0000 (UTC) Received: from CY4PR12CA0042.namprd12.prod.outlook.com (2603:10b6:903:129::28) by MN2PR12MB3470.namprd12.prod.outlook.com (2603:10b6:208:d0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Thu, 18 Apr 2019 15:00:53 +0000 Received: from DM3NAM03FT010.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::207) by CY4PR12CA0042.outlook.office365.com (2603:10b6:903:129::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1813.12 via Frontend Transport; Thu, 18 Apr 2019 15:00:53 +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 DM3NAM03FT010.mail.protection.outlook.com (10.152.82.65) 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, 18 Apr 2019 15:00:52 +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, 18 Apr 2019 10:00:50 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH v5 4/6] drm/sched: Keep s_fence->parent pointer Date: Thu, 18 Apr 2019 11:00:22 -0400 Message-ID: <1555599624-12285-4-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555599624-12285-1-git-send-email-andrey.grodzovsky@amd.com> References: <1555599624-12285-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)(346002)(376002)(136003)(396003)(39860400002)(2980300002)(428003)(199004)(189003)(486006)(14444005)(2906002)(11346002)(476003)(426003)(356004)(86362001)(336012)(2870700001)(126002)(44832011)(186003)(6666004)(97736004)(36756003)(478600001)(2201001)(4326008)(53416004)(77096007)(68736007)(446003)(26005)(66574012)(47776003)(50466002)(7696005)(8676002)(53936002)(316002)(305945005)(23676004)(76176011)(5660300002)(5820100001)(2616005)(54906003)(72206003)(50226002)(8936002)(81166006)(110136005)(81156014)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR12MB3470; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6a4b66fd-486d-4199-5cb0-08d6c40ea707 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600141)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:MN2PR12MB3470; X-MS-TrafficTypeDiagnostic: MN2PR12MB3470: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0011612A55 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: LIlUqaabE/muC9qCCIa7fKk2Os9zJBHNf+25SUqg08optFRcdjVx5Q3LWfd+kD9pDPKs+/OLUEx14IPfrbef4XMuFc+EAZZBqD4+Y8nqzVJGedxHcRSpFVuXwtKBgzltj22gdFVIJ4b2cEV0AWx5aXzZOvhwl1p77JZ6pu5MaDQKR4ThZ+ty1Fv76e4XXHAP9bvdu8zmltksu5bdxtW2dFPLkpZ8qS4ibEpGeVhqDBHOF9jD7fG0AD+2SJCaydNnOaOuSNW6boKx2k3R/ZpJ9GEuAQfKpl/8IPnJOS8vM5v4VhA+P/T8cD35pUfQmifw5fq+6pabcr9+V7Xckg3n6WvDirdNybA+Div+Tej3DYWMMM1HLY9+mk2565zucqPs9hGP083d/+QAFpPuOaGlzMwoYbrAaErzCZnQzUc6hwE= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2019 15:00:52.7015 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6a4b66fd-486d-4199-5cb0-08d6c40ea707 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: MN2PR12MB3470 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=9+NYb+9fHUL7qhoomz1Y6zHjBbkEyfUook0CTqlr8ao=; b=RyEfHHe/fRArOPmOLlAQEmy2MlDf8DFVr+gKwBtOfwTapG1gKpjgD/tPneHfXdz8gEB8lmasg/jIAo8AfdKlDO+hRBjpICvATuGvs5Fpa4OXnojC2504vKwqYtdJthub85ZGX3kkwOTTv79w79LEU9FTWYcAJ1e0mOK6SYvENWI= 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 7816de7..03e6bd8 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -375,8 +375,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 { /* @@ -403,6 +401,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); @@ -477,6 +483,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); } }