From patchwork Mon Oct 22 20:46:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10652509 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 2D2E814DE for ; Mon, 22 Oct 2018 20:47:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C9D528C29 for ; Mon, 22 Oct 2018 20:47:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CD8E29022; Mon, 22 Oct 2018 20:47:17 +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 27B7628C29 for ; Mon, 22 Oct 2018 20:47:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D8D589BBE; Mon, 22 Oct 2018 20:47:09 +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-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CD3D89BB0; Mon, 22 Oct 2018 20:47:08 +0000 (UTC) Received: from DM3PR12CA0114.namprd12.prod.outlook.com (2603:10b6:0:55::34) by BN4PR12MB0738.namprd12.prod.outlook.com (2a01:111:e400:59bc::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Mon, 22 Oct 2018 20:47:05 +0000 Received: from CO1NAM03FT062.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::202) by DM3PR12CA0114.outlook.office365.com (2603:10b6:0:55::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.29 via Frontend Transport; Mon, 22 Oct 2018 20:47:04 +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 CO1NAM03FT062.mail.protection.outlook.com (10.152.81.50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1273.13 via Frontend Transport; Mon, 22 Oct 2018 20:47:04 +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, 22 Oct 2018 15:47:00 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH v3 1/2] drm/sched: Add boolean to mark if sched is ready to work v2 Date: Mon, 22 Oct 2018 16:46:53 -0400 Message-ID: <1540241214-21077-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)(346002)(396003)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(8936002)(72206003)(53936002)(105586002)(106466001)(86362001)(104016004)(478600001)(47776003)(36756003)(6666004)(356004)(110136005)(54906003)(53416004)(450100002)(316002)(4326008)(16586007)(77096007)(186003)(68736007)(2906002)(97736004)(476003)(126002)(2616005)(486006)(44832011)(336012)(26005)(426003)(81156014)(81166006)(48376002)(8676002)(305945005)(50466002)(7696005)(5660300001)(50226002)(51416003)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0738; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT062; 1:1xI2ez+Rao4sYXUjj1ucsYth8q4ozCV6fLqO9fWeTAQCIWAH6MqiK0IKSuavMis1Swlj2Ta80G2xLrT2gQoZs9TvCTPjgBF1UWXZJ2eEml0lcxaGlqm+aIp1IZBHv5zw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ae5ba25-d34d-4af5-f5d6-08d6385f8654 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BN4PR12MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 3:5xUN8o5CcaHS0ZtmlSPb/gwr68b4nPDEI0Vfe3/CyYfxj2FSfgnVPPlJLEw9vJhkPr0YtKOxaskRhH+wx0+WzBTZKAVurrx1hpeAAOFdwIKMoK/c0DqXGvyBWOXQl5D5tUN8/wSAco6Mjf599LkNv+OX9nBXcV7hmf8fR11GgOZE8hN9maBAQ8OY28YAqzAd3lBm+9etwLQ210+4jzHT0vm+BJZuwLf+zNjx+x4/AtRcIpt4e9rDFfsmMT8U1z+poU1vAwx7SmIo51PMSXDKj2SJKk0FKiJ+aZXJlW0F+SIpu132OMw0X+rxNvzC6fBMJlyIityG6y6BByffO6/c//eWrSmad6EdzfL5oYQLL2E=; 25:nW1G4p7ufR8FZOP2Y6SNQpclbRzG+fEe1hm55YQTJlInKQ0Hm2Ge4gHVKL8Sde7sI1uwXzQkMwkOw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iHP602GkwhEmgdLOUANAdJAzE+ebjDsMrX4LLSFEAcfscKXFbx 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)(3002001)(93006095)(93003095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BN4PR12MB0738; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0738; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 4:mX3onHI4cax1MVJ2XBWPsvjho/i+2R+HLne9jjfrdF/NK3h301MVNhiOKdBscNVV+jlwIaeFnAywhzdR8QtFN0Y4QEoDVf+EErJQ06hWrD04E2yeD5len+VIg0+rEcPHyewhPtdTLeyCF6/aHjbZnahguDu8CIBwPGEAe9tl2NXmkiLk1JMHvybt3AeAouTxNWgoslRG0S0pVKCXBMA57Lac+sY/dNy4GUUZGVdypbdzB1CEhbTh4hIeZnz3uLSwFC4Dpj1xUJjASAwBm5rJugTktGZ5LL8kWpWa35btEnE/sblP3UmC3wqGdVS2/tX/ X-Forefront-PRVS: 08331F819E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN4PR12MB0738; 23:UqQbVdMqtpWWqAvDAyr6/e7KLcfKKYHweiiOp9++Z?= d1GtBpN6stAmBbUqPj82PTUEUKlydRqhKqH+3wPzfgJaJKWsjV+0fjmHhTEdm8kIaR1Vc5e7v9uAF4IGPfjnb/0LM5dKJ9gv7SxRfCv6XrAtgvw8aFEHr74ZLSQwCPSEgvizxXDafh1oPrlex7DFwXwTF7kU/3uIHyU39F7W5sna/qWcYjmic2yIzsvK+vBCpx1LwZqy3C35hN6mUUHDr4dC5yS+U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+NI0IppnxRT6zyfIONFG7qjBIWGvWbw/vyHp6fVY9uqBYNVciSpoBHAzmmfLUDCK/BwOEU9RA/kHGYSh1n3ndWDkLqJHNmvucF SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0738; 20:Qw+QbfJlrIAOtvNQtZG0feqImwI+0JzlY0/5LeG/kXbvZHTfgaeIroslugMuNS5++8yL/81AqdhE24f+pGTMKP2T+nSvTjnN2Koenvvsl+S9Er9/7jzHnx1XRpcY205VE7/jEmCU6szxHLX96DlWSarZhVQpvO8U6TfCk4afIvOr9eiNVBwTUU07j5tmrUYiviAGM0uFM8O4cBDAbNhRjWGnep9XsJPAX1zdlsx7d3Rl4XXAX32Xz0aZkoIXe0Hd X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2018 20:47:04.1892 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ae5ba25-d34d-4af5-f5d6-08d6385f8654 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: BN4PR12MB0738 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,