From patchwork Fri Oct 19 20:52:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10650191 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 D2311112B for ; Fri, 19 Oct 2018 20:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB9027FA3 for ; Fri, 19 Oct 2018 20:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD59628451; Fri, 19 Oct 2018 20:53:02 +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=BAD_ENC_HEADER,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 AC3F027FA3 for ; Fri, 19 Oct 2018 20:53:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83A0F6E553; Fri, 19 Oct 2018 20:53:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0076.outbound.protection.outlook.com [104.47.32.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1CF36E553; Fri, 19 Oct 2018 20:52:59 +0000 (UTC) Received: from BN4PR12CA0007.namprd12.prod.outlook.com (2603:10b6:403:2::17) by BN4PR12MB0740.namprd12.prod.outlook.com (2a01:111:e400:59bc::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29; Fri, 19 Oct 2018 20:52:57 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by BN4PR12CA0007.outlook.office365.com (2603:10b6:403:2::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.20 via Frontend Transport; Fri, 19 Oct 2018 20:52:57 +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 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.1250.12 via Frontend Transport; Fri, 19 Oct 2018 20:52:56 +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; Fri, 19 Oct 2018 15:52:53 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH v2 1/2] drm/sched: Add boolean to mark if sched is ready to work v2 Date: Fri, 19 Oct 2018 16:52:43 -0400 Message-ID: <1539982364-6533-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)(136003)(396003)(376002)(346002)(39860400002)(2980300002)(428003)(189003)(199004)(72206003)(68736007)(54906003)(110136005)(53416004)(106466001)(47776003)(105586002)(2906002)(2616005)(97736004)(126002)(356004)(336012)(44832011)(486006)(14444005)(86362001)(426003)(6666004)(476003)(16586007)(104016004)(50226002)(81156014)(186003)(81166006)(26005)(316002)(8936002)(50466002)(36756003)(48376002)(77096007)(305945005)(5660300001)(4326008)(51416003)(8676002)(7696005)(53936002)(478600001)(450100002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0740; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT015; 1:czcb/S+QvfZmITzoklcA0vaU/lr08uf3Fr+6XDUPxohVSPf5lGf5tHna5Zj2UB+qv/Js5u8H903Eh0I8jderj66v7ukiVJ+wf2Rxd+ZDROenqBbd2cqGa0TYF3CGUSQl X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 828ea064-aa49-4593-859c-08d63604d930 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BN4PR12MB0740; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0740; 3:e8wg995T9l2N9R/UZRu1/KnvQm6WXpzNrxGiGcOd50RX8pytjaxrU2ttLfSrJURdP3uNLuOE+72mvBizyvJGLqSAS4Eb4+XHnFgVmxii5ifKLggkwvuVdak6rDBp8QvAZ5IjgQmnyeOyOMMLWvOz5RDPzLEGUrSDvD3DtdxjCs3fSHsEeb5GNzKdQLLUUhViyhwNj7v1WW0y6WaDg5DMGSABxbJJNftgrMSXE8XYsoXR9efThKu2vxQC7L79x+rWHCJSM6kmZeYDVBxjFwBin7qIpqNbIyf2dZCGShvD/AmOMtxrsgiL/7TJrcL3naK6WRuBWtkogjRUEWhMCczeI/VRSgbGWWw91girVdtYvCA=; 25:wIXKB29pK91J4YwNtuKGtMttO4yzIto+iqCE8Zo2y5bxmO5zsPx4Xv0MAmTbgxXoUBfyI64jtIc7KP1HnPvWvzXQluRzIry+Dw8mJwBEk2NsaOQWhWJ1IuRKAfASXdToae8SH4B3wDetsxr8dw5EtY1g/wb1a9RdoClh3u1QVxwKSFZBELo168+C8kDSNzkB2kVsDegv+/nqCVxKqfcD/OKGuk9vbBY0B3amEeomC2LIvjFQUk/niymLjKmVv99aT4IupLdRL0bB70XAxx7c+VVxHcEM0c2+z101ABey1Tu46AltQpWWHIZr06WCyGfd1kQuGYAfQ1JisxKYbej0xZR9Ot5XvKtjXSRsLAtIlas= X-MS-TrafficTypeDiagnostic: BN4PR12MB0740: X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0740; 31:Rp/eJk7ixK8AG0LL4S/npjlzQJWIGAxzpsDmtoeDpJHHQ1nJNPMe6oY5so8W1m01yazxPPOzmdN3ClWQ/Mczaejd/E6LmAyyonpwWfytCzp4PyTk1LU/9dEif8kiAwzLNbYlw2nHkbQaLLdrNu6eqbg6XajJGT/XAwb+8L27YSoLze10/tScEkreG+iricsiOHucDog8k6Ha37shlftBx1f5gmePxu1VqEE78YrrvZ4=; 20:L7ZW+sOCr0M2cebpwwmqysW14PNOZnwrRy535WsP+jvslvQ2SC5+3uuj3BXN7g/u5pbhw9eWz+6RyeW/QlR93tgfPdlFHCjDXZ0ccl80jp2A1JZW5XPioq+wGCw/+0Z/sk3YhTp7tfbTBix+w6UPeVh/I9gLuuz+xfwRYxjOEoXDh7b0Qp3Zlk8zMNgI30BFhnkAgaZly65V5ECIojdAJsecnUl+CeJGefWaQr3HKIjpRr3aefBCdkCGCRuza1U/j1jO4BoF4GS+GYT+QbBPbofzN4JQgcxMHwNLKJD1dQBMWeR9nXcUpX4vQB0pvBk45qKYpR/trFBN1ezwN1kK/tWNYF1kolwyr0KICIsBIEJE08fqWPYzpipLYmwGsReTrVHhjvrj+QzbfGe1LFJG3ToskJxlM3BwGmVy/q5GPcxeYgmdy+6mt7ehX1rCGfj731dqcvQiJgDgh40u31kqxsIP882slbSSWRxbCS4v01m92cfZ9+Q01bK/CO1k0r16 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)(3231355)(944501410)(52105095)(93006095)(93003095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:BN4PR12MB0740; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0740; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0740; 4:0z553fRWPkdj/rS2345Wa6g0QMCzfL1vBGQbNMP7A6OPhvtlb4dgwT9v4dqxVDidKs78r8zhPT7KumUncRQ/c7WKouNw8J69Y/ZJZ63uWRy5am9WXnAgeda4tH+kpcgQFmPYhcS8anB2OuPm9vtDhw9r6lnde9ZyqYR8yIcdnPzm9NsbtoYEYQgncr2IJx/AdFnf6y+rvo8ZyHzba+288A9V1HQAEa/GTyhgI80LJAW/Ela+DPhnIUVz5AFDyPrgPnnoabrfI2mAdhgmuo1E2aZEs1GKvX1KDoEkCG6QjxlsOnFCcpZEcRF8CjolTiVa X-Forefront-PRVS: 0830866D19 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0740; 23:NDzMuLLmVeR3v3565NtbmM8nShmOQg4k/BWyCbPkP?= YyN0Q7y4BURwFizQus/WT9kFTE1WVd7I+Cz1O/Eay2kiQAZcMMmA2pGZoIsSypl0B97RHNfK+j7kV5ygbkBGoIsZ1Cx/QKWgN9BvKbEnVaXOd7c3TY2iIKVEpxSiUxXeKhmT1gafUu0zjj9mUb4FCvVawyI0YJ1hh2CXyUb07REUPe5KDfObUy9wNnPoTUMn1EM8saUXv2NiaV1iVS5YHF/PnINEEV5NFWcYLqQ2tSdzC32e557r53J0mur+A7W5DGW46HTa+H97hfGiLVLQrK85MD8Kp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gQdYjq+CRwnuI9bSR1CSjDN6Rh7QG53K SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0740; 20:Rtm4Qwj7zEMEQiel3NQbwVMaJLBHD3AvvxNrHNpS22JIo1qYWJNR2GvKAqa0ltMi9nuD0rhW9Xrs7bHHCvEqc6ECecCwfrlWAPdv6IxW2knNmIOh21JjENruBfckT9yYUds9kL1UNyv6VHtSV8B1rePrzDzktdIc1ESJoPBWNIUwXu/hDqb9lqx9dgs15jlPwxQaIOEbwXdQW94Tckh/fN1Xzc7iaXN1/LNhLlAYSFaOAEqOf6DOcuKBKyhHTQau X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2018 20:52:56.8921 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 828ea064-aa49-4593-859c-08d63604d930 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: BN4PR12MB0740 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: Alexander.Deucher@amd.com, christian.koenig@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Problem: A particular scheduler may become unsuable (underlying HW) after some event (e.g. GPU reset). If it's later chosen by the get free sched. policy a command will fail to be submitted. Fix: Add a driver specific callback to report the sched status so rq with bad sched can be avoided in favor of working one or none in which case job init will fail. v2: Switch from driver callback to flag in scheduler. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 2 +- drivers/gpu/drm/scheduler/sched_entity.c | 9 ++++++++- drivers/gpu/drm/scheduler/sched_main.c | 10 +++++++++- drivers/gpu/drm/v3d/v3d_sched.c | 4 ++-- include/drm/gpu_scheduler.h | 5 ++++- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 5448cf2..bf845b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -450,7 +450,7 @@ int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring, r = drm_sched_init(&ring->sched, &amdgpu_sched_ops, num_hw_submission, amdgpu_job_hang_limit, - timeout, ring->name); + timeout, ring->name, false); if (r) { DRM_ERROR("Failed to create scheduler on ring %s.\n", ring->name); diff --git a/drivers/gpu/drm/etnaviv/etnaviv_sched.c b/drivers/gpu/drm/etnaviv/etnaviv_sched.c index f8c5f1e..9dca347 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c @@ -178,7 +178,7 @@ int etnaviv_sched_init(struct etnaviv_gpu *gpu) ret = drm_sched_init(&gpu->sched, &etnaviv_sched_ops, etnaviv_hw_jobs_limit, etnaviv_job_hang_limit, - msecs_to_jiffies(500), dev_name(gpu->dev)); + msecs_to_jiffies(500), dev_name(gpu->dev), true); if (ret) return ret; diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 3e22a54..ba54c30 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -130,7 +130,14 @@ drm_sched_entity_get_free_sched(struct drm_sched_entity *entity) int i; for (i = 0; i < entity->num_rq_list; ++i) { - num_jobs = atomic_read(&entity->rq_list[i]->sched->num_jobs); + struct drm_gpu_scheduler *sched = entity->rq_list[i]->sched; + + if (!entity->rq_list[i]->sched->ready) { + DRM_WARN("sched%s is not ready, skipping", sched->name); + continue; + } + + num_jobs = atomic_read(&sched->num_jobs); if (num_jobs < min_jobs) { min_jobs = num_jobs; rq = entity->rq_list[i]; diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 63b997d..772adec 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -420,6 +420,9 @@ int drm_sched_job_init(struct drm_sched_job *job, struct drm_gpu_scheduler *sched; drm_sched_entity_select_rq(entity); + if (!entity->rq) + return -ENOENT; + sched = entity->rq->sched; job->sched = sched; @@ -598,6 +601,7 @@ static int drm_sched_main(void *param) * @hang_limit: number of times to allow a job to hang before dropping it * @timeout: timeout value in jiffies for the scheduler * @name: name used for debugging + * @ready: marks if the underlying HW is ready to work * * Return 0 on success, otherwise error code. */ @@ -606,7 +610,8 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, unsigned hw_submission, unsigned hang_limit, long timeout, - const char *name) + const char *name, + bool ready) { int i; sched->ops = ops; @@ -633,6 +638,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, return PTR_ERR(sched->thread); } + sched->ready = ready; return 0; } EXPORT_SYMBOL(drm_sched_init); @@ -648,5 +654,7 @@ void drm_sched_fini(struct drm_gpu_scheduler *sched) { if (sched->thread) kthread_stop(sched->thread); + + sched->ready = false; } EXPORT_SYMBOL(drm_sched_fini); diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index 80b641f..7cedb5f 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -212,7 +212,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_sched_ops, hw_jobs_limit, job_hang_limit, msecs_to_jiffies(hang_limit_ms), - "v3d_bin"); + "v3d_bin", true); if (ret) { dev_err(v3d->dev, "Failed to create bin scheduler: %d.", ret); return ret; @@ -222,7 +222,7 @@ v3d_sched_init(struct v3d_dev *v3d) &v3d_sched_ops, hw_jobs_limit, job_hang_limit, msecs_to_jiffies(hang_limit_ms), - "v3d_render"); + "v3d_render", true); if (ret) { dev_err(v3d->dev, "Failed to create render scheduler: %d.", ret); diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 0684dcd..037caea 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -264,6 +264,7 @@ struct drm_sched_backend_ops { * @hang_limit: once the hangs by a job crosses this limit then it is marked * guilty and it will be considered for scheduling further. * @num_jobs: the number of jobs in queue in the scheduler + * @ready: marks if the underlying HW is ready to work * * One scheduler is implemented for each hardware ring. */ @@ -283,12 +284,14 @@ struct drm_gpu_scheduler { spinlock_t job_list_lock; int hang_limit; atomic_t num_jobs; + bool ready; }; int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_backend_ops *ops, uint32_t hw_submission, unsigned hang_limit, long timeout, - const char *name); + const char *name, + bool ready); void drm_sched_fini(struct drm_gpu_scheduler *sched); int drm_sched_job_init(struct drm_sched_job *job, struct drm_sched_entity *entity,