From patchwork Thu Oct 18 18:44:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10647827 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 DA3FA13B0 for ; Thu, 18 Oct 2018 18:44:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD56A2905F for ; Thu, 18 Oct 2018 18:44:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C146329069; Thu, 18 Oct 2018 18:44:45 +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 429C929064 for ; Thu, 18 Oct 2018 18:44:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD14B6E0B7; Thu, 18 Oct 2018 18:44:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0044.outbound.protection.outlook.com [104.47.36.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25F4D6E09D; Thu, 18 Oct 2018 18:44:37 +0000 (UTC) Received: from BN6PR12CA0045.namprd12.prod.outlook.com (2603:10b6:405:70::31) by DM3PR12MB0748.namprd12.prod.outlook.com (2a01:111:e400:5984::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.20; Thu, 18 Oct 2018 18:44:35 +0000 Received: from BY2NAM03FT049.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by BN6PR12CA0045.outlook.office365.com (2603:10b6:405:70::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24 via Frontend Transport; Thu, 18 Oct 2018 18:44:35 +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 BY2NAM03FT049.mail.protection.outlook.com (10.152.85.177) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.12 via Frontend Transport; Thu, 18 Oct 2018 18:44:34 +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 Oct 2018 13:44:32 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 1/3] drm/sched: Add callback to mark if sched is ready to work. Date: Thu, 18 Oct 2018 14:44:19 -0400 Message-ID: <1539888261-331-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)(39860400002)(396003)(346002)(136003)(376002)(2980300002)(428003)(189003)(199004)(476003)(106466001)(426003)(486006)(53416004)(50226002)(450100002)(104016004)(105586002)(44832011)(4326008)(8936002)(68736007)(110136005)(97736004)(2616005)(54906003)(126002)(336012)(14444005)(72206003)(186003)(86362001)(50466002)(53936002)(77096007)(2906002)(26005)(16586007)(316002)(5660300001)(6666004)(305945005)(478600001)(356004)(575784001)(48376002)(51416003)(47776003)(81166006)(7696005)(81156014)(36756003)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0748; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT049; 1:RP8H0sdU+Fw4VGPC3D+XBtYi6e2G+PS5G2536mTnQB4MZ6CZjq6XvsnEIZ5oIzgFVJ/hQcYja2jHEnOwNoEtYQ99JhdSSFySKjuW3UqPpk9KW70p7+a2LEeHemxiLHJS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8680c90-401d-4764-c23e-08d63529bfec X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:DM3PR12MB0748; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0748; 3:GFrfBwJmL6Ifns9LlQSl/ccCOVhtnlUsx/zTKVT+h2gTVdZ2zmDYBf046gZuCI9sanNJ/4Ymu9/x4bunlX4MRDbEWeZAIz0O+Ejx68MsYFQmhODLDfRzLFLGCNNrTJnt2UwdeqT6NWDILKDQnevd4UabRs/dueqJaRtvnIBOvf26auIr2UNP0wuhMMJSxTXFOJMJbrDj/aZ98nZ8tiCcWOVfZJPHSMYd99K/zR8HYzLpKILKHOkPl2e6ULzw+BjjFYtmXB9vCOZNqnCarS7QBiIgx3hzWT7J8BxptZn25KmRaELwr6mv7wlhlNd8PgF5NZ2o0pNrWOpkJOejAGvu4CUHmHUJrJVnAJNB/YL7ITg=; 25:AYE9WSO39awB1/7fimke6LvjhW27+P9lDYB5qP7SH0zMwH/OUbkJCxebs4UftBn/27dZzy5V+R3F/l+Ayv34qeHR68Zs6+C5WJ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igA1q8JK3sV 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)(5005006)(8121501046)(93006095)(93003095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DM3PR12MB0748; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0748; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0748; 4:MBJCJPTVBNTs448xE/3ThlOjE1tPePBVmOD7BGiP7xSJUhQwOhdvfZqRh+4SYrAsfRjrraCQ0GiCWDwqxkCmWzL8MFCkkpTo4FQ34MPUr1UM44f7hWzlXGQH9R5WKlgj4x22DxzOZg4QPhVIfawsvkpo2CNgWAxULw3a5tOaTKQR/BhR+ErtNQO6VjZq1xLVZZkPmfYOR3M7jdhntMaZdGB6OipVfzOwgi9YmWn0ar4OH7sfKFpqPZFwzhBM9u+qu2/6bauNcpFqtqrbrR6uW1tKGUvGnXidOWCs9EnGBY1XzxB0RxIbawXO1RwuqZhE X-Forefront-PRVS: 08296C9B35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM3PR12MB0748; 23:X0MXizFDJscRZkccipnjfRg3hTwxRlQYLYEBiC6JK?= UySEOAUZzPuNeaMfUEikYb+nsSMrGMAl9U9KNBSEG/A6mS5PIcVN2MwPtr3IkpCZhvq5c4WThe/0jYR5Y4+ogRbogDh29ZIt94XQVwmNqxDFs/87XUaEbgBsgrT6rUYkXQjNSa7/6i97HvN7ufRh6rIQePQ4GtpnUv5XeBaZHr4ZmZcmUXst7JRednELgOz+VIEa/K3wX6af8ynJZ9ydro/8PP7gIrgfG6FTmLGZmi933YIGXyJl7LRThApGs1ArTkJ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EqDSYuEeA2jBOV8Li7UCeUkEI9MN76t7XLcAlK5nO2kPS5/i8WdDTDDRWgR7PJccvV/+J4fkD4IVKtFxG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0748; 20:0h146UJGJMv7Dw8xcGJlQRwoT1ETek2qY9xdNBHprHJ8zpXJ6OD0gi8juCOo7F4aa1+q/4jJH0HjONSv0zU2eSVO/yKtg7fNS/Al3Ik25uc4dpkAhVR6hWq2kfFoU+HQuqjOb5CvhUYnLQ5Y7DPEGqtm0UpiROMqVB42vb2ECd0szrqxeEVI67y+hvf+M5t6mL3vZPIw6RpA7i2QX6YReWTETEdPz8XHdswmH5abXFTj8cszJrLCXaZo2WnX1IGS X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2018 18:44:34.7524 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8680c90-401d-4764-c23e-08d63529bfec 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: DM3PR12MB0748 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 sced. status so rq with bad sched. can be avoided in favor of working one or none in which case job init will fail. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 9 ++++++++- drivers/gpu/drm/etnaviv/etnaviv_sched.c | 3 ++- drivers/gpu/drm/scheduler/sched_entity.c | 11 ++++++++++- drivers/gpu/drm/scheduler/sched_main.c | 8 +++++++- drivers/gpu/drm/v3d/v3d_sched.c | 3 ++- include/drm/gpu_scheduler.h | 5 ++++- 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index 5448cf2..bbfe7f501 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -404,6 +404,13 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, return 0; } +static bool amdgpu_ring_ready(struct drm_gpu_scheduler *sched) +{ + struct amdgpu_ring *ring = to_amdgpu_ring(sched); + + return ring->ready; +} + /** * amdgpu_fence_driver_init_ring - init the fence driver * for the requested ring. @@ -450,7 +457,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, amdgpu_ring_ready); 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..5094013 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_sched.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_sched.c @@ -178,7 +178,8 @@ 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), + NULL); if (ret) return ret; diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 3e22a54..320c77a 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -130,7 +130,16 @@ 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 && + !entity->rq_list[i]->sched->ready(sched)) { + 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..6b151f2 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; @@ -606,7 +609,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)(struct drm_gpu_scheduler *sched)) { int i; sched->ops = ops; @@ -633,6 +637,8 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, return PTR_ERR(sched->thread); } + sched->ready = ready; + return 0; } EXPORT_SYMBOL(drm_sched_init); diff --git a/drivers/gpu/drm/v3d/v3d_sched.c b/drivers/gpu/drm/v3d/v3d_sched.c index 80b641f..e06cc0d 100644 --- a/drivers/gpu/drm/v3d/v3d_sched.c +++ b/drivers/gpu/drm/v3d/v3d_sched.c @@ -212,7 +212,8 @@ 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", + NULL); if (ret) { dev_err(v3d->dev, "Failed to create bin scheduler: %d.", ret); return ret; diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 0684dcd..a6e18fe 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -283,12 +283,15 @@ struct drm_gpu_scheduler { spinlock_t job_list_lock; int hang_limit; atomic_t num_jobs; + + bool (*ready)(struct drm_gpu_scheduler *sched); }; 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)(struct drm_gpu_scheduler *sched)); void drm_sched_fini(struct drm_gpu_scheduler *sched); int drm_sched_job_init(struct drm_sched_job *job, struct drm_sched_entity *entity, From patchwork Thu Oct 18 18:44:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10647829 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 B411D13B0 for ; Thu, 18 Oct 2018 18:44:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5FBA29064 for ; Thu, 18 Oct 2018 18:44:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 965312905F; Thu, 18 Oct 2018 18:44:48 +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 811AA2905F for ; Thu, 18 Oct 2018 18:44:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 94B9B6E0C4; Thu, 18 Oct 2018 18:44:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0057.outbound.protection.outlook.com [104.47.40.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F57A6E0C4; Thu, 18 Oct 2018 18:44:44 +0000 (UTC) Received: from CY4PR1201CA0009.namprd12.prod.outlook.com (2603:10b6:910:16::19) by SN1PR12MB0431.namprd12.prod.outlook.com (2a01:111:e400:5865::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.23; Thu, 18 Oct 2018 18:44:43 +0000 Received: from BY2NAM03FT064.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::201) by CY4PR1201CA0009.outlook.office365.com (2603:10b6:910:16::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24 via Frontend Transport; Thu, 18 Oct 2018 18:44:42 +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 BY2NAM03FT064.mail.protection.outlook.com (10.152.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.12 via Frontend Transport; Thu, 18 Oct 2018 18:44:42 +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 Oct 2018 13:44:40 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 2/3] drm/sched: Expose drm_sched_entity_select_rq to use in drivers. Date: Thu, 18 Oct 2018 14:44:20 -0400 Message-ID: <1539888261-331-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539888261-331-1-git-send-email-andrey.grodzovsky@amd.com> References: <1539888261-331-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)(376002)(136003)(346002)(39860400002)(396003)(2980300002)(428003)(199004)(189003)(486006)(186003)(47776003)(8936002)(68736007)(53936002)(446003)(54906003)(14444005)(110136005)(77096007)(11346002)(51416003)(16586007)(7696005)(53416004)(86362001)(5660300001)(2616005)(76176011)(44832011)(26005)(316002)(8676002)(97736004)(105586002)(476003)(4326008)(81156014)(126002)(36756003)(50226002)(305945005)(50466002)(478600001)(356004)(6666004)(450100002)(81166006)(104016004)(48376002)(106466001)(426003)(336012)(72206003)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0431; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT064; 1:gAWKmAcv2J5CwKnE4dMdh/uUCrJorDzpl66NuHIAQtUVkNK7UHU9yVxAdJEgWYujtQRNa8auB1mI566WVoQlRFZupEsLywmcGOIy2oDZiXZs2N5reJyViZLApQwxzCIZ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8858799e-3dc2-49b2-0bb8-08d63529c463 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:SN1PR12MB0431; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 3:IZeDZmNseT/1Wc556RHlivPvezARTd0/z407eUws6TtycDjbvvMIyvAdh/RcBBvqbYcYeZBv65kVv0PYhrPHeL/EE33nXl364OewQVk5M3cyp1NPxbjtS1zm00WSLGSddvOJoHqrmpLEpFbRDb8TAJYAocdUeAUIQ4rp0WFKLJEIZKheZIF/O9He1QAE3exOqSw0xsfJ9dIoOt5rb6qOV/s5r6VWXUk5Ygvwv6SS0AtAdLB94yvNJvItcZtJnTeGgzCGY+SmixueyesQz0rID3LxWZs3GIXCmi6+0nAyrsENxMBJLYhQHge+5jnX4+Nt+BInT5DT2Ys8whJXl2GowQvZZu0B7/UfmZPQNsNSQj0=; 25:DtycZ91obKRl92kMz4vrnpK1ddJH/mKH07zlmeymDQoDAZsJAb4eaAKCjHO8q8HL6+IplGKdxbbdyzIqj2AtGJ2gOiW/Vdv0RjpufdkpDCC3uI/8Mqelem575WUq6S+0a3+TN6TeytCY6ZiihYhdFOcPCmUDTaZf2wwT4RrTRdQlA0BkJk//YibfqFcGP9BiTcFSzsaoWC6HGS2ug5HsLVgS16xDN7bQPC6WgQmrSYTwZs0HMjeFkLSwZx3xaBNkUpC/Db/nlqvUb/DIjOphrR5Msb4mdRj8DpazaFFV01fX5in3dQ1Sl+LmtK+w+wXQCJqm1oVPVoiXiWXfrOPLMA== X-MS-TrafficTypeDiagnostic: SN1PR12MB0431: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 31:FwqLEGyPWA1IZvWI3c24r8CSe/AgnWclMMC0P235hKDbZDuY9NDzW+d1zi3aOwB6elyDIK+1zDnQMA1MILbNEr9Vm8RhtCZzmYHCwWpME2hEboKJ9aDifQRkrNMyJqtK+DK7TxCu3s1nWLO6wQ73EAkh8FVZQOdR27qHN9P9tDPdjg/Txhld+1ZJxNeKuvypPmGoPwd7KUxcFK0TTGt1dQb8Fxji+4OYtE6b+WJbSBQ=; 20:hZiBF5SDKlvygG6gvDIHVWnYztg3wY3+cLhMgjCJJfkAFDuNNYixCD35o/hkIoFHQbGhohLKP7eQIYGI1ci//5kAfqT7z+ZI9h+pJx8JTGXdh49wlgBXge2kClX9MivFjmDqHIKZq62HPa9QMJaPcwcl/zAwPQpcVWfnoAPNVAbjzbkInOZIdlOoEx+24ZYsZuVOWFPpCMMaXxwe+joM4oUTZUc1EKVDcHKFUrC+hhuqlf86/gNdjo0AehlOb4DNQu4EpaDPHLphF2M72mZXs7tkZNSYLakalmaeY29eYag1pcyp64UVMGJOy4GJ7se4xVhIW7hBOd997/pDdU6b34FgoZtSZHb2T+oUXiYYg98Ana+CuBMKvO2v2eP4sBDn7SeFF5Kzx0HAlXXJbBfngNryDStA6gskjcBQk+YxIxGN92e7gsIUzT4ArSKgIVNgGQgk/VrsBwHpTDnAlyx3AjUB4x7bZXoag5Kd5opmqg5hNH8oSigzcPwHNA5heWKp 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)(10201501046)(93006095)(93003095)(6055026)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:SN1PR12MB0431; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0431; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 4:wAUIiVDs7Q6nhqZWdKSi+ExweENZwBJF5MvFXbVbQJrf0Mgh0nBl+0iW7egLgP8PegLUJgscOfTWyT7HSe14hlsCc7Cencb0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S4AFr5g2HrWbkSp7QqsmEDFiLiqMXSjK9mE4s9VmKAVotmqr7cq+FuvxFS3l8AIto7frG/B+9iSG6c7xMdP3jggMwaW/9Z+v6/yCrcCR60KgxcqpsEQbftQUPmyas23Z4KnWiW6OP5CjpPo3Xel2CYdnMyydOEuBcQM9j9OFVE7LuXjdb2hbLnmeId1UYhoKmCE9jQYF2d4foBd5Ryl1FAtBlfjJRbt5Eqp28ct+/Fz83PUDiri+caD4wkH6buA==; 5:Cnx5ffGO9kDBDdqrC8iEU41sFQR3xtAjUps3GH1ZUNwq9nnPmcWvau1HBOjJXBhsj54g+v7ClSDfZhYY7zdnRrgrc4hWj9y85usVbc+8Gx5IUKS9qpoX8JViQ3xWL6Wx4PwILoU2inwFaYp6Otp4uTQrgD+PqwRJ0IsGDi/T+sk=; 7:a9b4RT9FZKa7PkWFK5u2FjDrqRQ6Hz6tT8BD0nqUS5mZZpXLDZPnVC5Jgsazu6SZZF+Yf2YHR68n/XukUGPkJ/Kc4vw/QMik7T61nEhb88eVBQJafNGg9UfUAday6myjG+TU9LoSkd+5TUckv/QwEiMenuwM+HxeLICHQ61IET5eGeHdVrcSUgP93oQJdewYVGGxN6cyf1a9osbbkiewdFOHxBFRc0Z+EYM691RIU89+uCiI6ppDJmlSD/UoZfsz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0431; 20:z3ic/JOXXt8f/zAEVA6X7XHsSb0gRmCN8YnByqIBHD15dqLLLFB0nqxFTKADc346yEzK3BRApvxDASnQe+TaMdUSR3bByjZmMpX3PUl7eYHHgTyk1eVrkXSuC7G4YxY9Qj5DEWmP+9D3R4bTWEeTMoDUZIVjC97fYRalYgO6NotyPqUrobV3mQETp4OA/J+1OhI4Uhl1f/GADidyyDZq4hvFZwj409meOmAMsFGjXNfUYpDKYMisN9bu97eLntow X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2018 18:44:42.2385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8858799e-3dc2-49b2-0bb8-08d63529c463 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: SN1PR12MB0431 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 Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/sched_entity.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index 320c77a..426606c 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -492,6 +492,7 @@ void drm_sched_entity_select_rq(struct drm_sched_entity *entity) entity->rq = rq; spin_unlock(&entity->rq_lock); } +EXPORT_SYMBOL(drm_sched_entity_select_rq); /** * drm_sched_entity_push_job - Submit a job to the entity's job queue From patchwork Thu Oct 18 18:44:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10647831 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 0E89A15E2 for ; Thu, 18 Oct 2018 18:44:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F227B2905F for ; Thu, 18 Oct 2018 18:44:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3C0229069; Thu, 18 Oct 2018 18:44:55 +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 8CFBA2905F for ; Thu, 18 Oct 2018 18:44:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F0B956E0C9; Thu, 18 Oct 2018 18:44:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0057.outbound.protection.outlook.com [104.47.36.57]) by gabe.freedesktop.org (Postfix) with ESMTPS id AAC196E0C9; Thu, 18 Oct 2018 18:44:52 +0000 (UTC) Received: from MWHPR1201CA0017.namprd12.prod.outlook.com (2603:10b6:301:4a::27) by BLUPR12MB0417.namprd12.prod.outlook.com (2a01:111:e400:516a::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Thu, 18 Oct 2018 18:44:50 +0000 Received: from BY2NAM03FT023.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::208) by MWHPR1201CA0017.outlook.office365.com (2603:10b6:301:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25 via Frontend Transport; Thu, 18 Oct 2018 18:44:50 +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 BY2NAM03FT023.mail.protection.outlook.com (10.152.84.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1250.12 via Frontend Transport; Thu, 18 Oct 2018 18:44:49 +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 Oct 2018 13:44:48 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 3/3] drm/amdgpu: Refresh rq selection for job after ASIC reset Date: Thu, 18 Oct 2018 14:44:21 -0400 Message-ID: <1539888261-331-3-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539888261-331-1-git-send-email-andrey.grodzovsky@amd.com> References: <1539888261-331-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)(39860400002)(396003)(136003)(376002)(346002)(2980300002)(428003)(199004)(189003)(478600001)(106466001)(68736007)(53416004)(86362001)(47776003)(53936002)(36756003)(4326008)(105586002)(97736004)(14444005)(48376002)(6666004)(356004)(50466002)(76176011)(8676002)(81166006)(81156014)(426003)(450100002)(51416003)(11346002)(186003)(110136005)(7696005)(77096007)(316002)(54906003)(44832011)(486006)(8936002)(305945005)(26005)(50226002)(2616005)(476003)(446003)(126002)(336012)(104016004)(2906002)(72206003)(5660300001)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0417; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM03FT023; 1:mt2yobZcuEUdUHLdHZ8/g++35MJ98QItDFfjrVVmXTuPNMJGU4tbLYZQBOH9snOQTslVBx8c9wxCcEYVjVggZ+lHjAsiGwMFWNINokEzYZS+0Bcs2w916+Qs0qw9mfQN X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b8ea4695-1a74-4f12-7b2c-08d63529c8e0 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060); SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 3:MrvfTOdIKXgjzayCfARmJBVXzaW8BwTTfWRdyt6kLhCAJJ0ywUkUMlgHjp2QPo1YdrtmfTl+Q+fHE5QTCb+z5o+4W9LPXYcd53Uou/LewiPKGbbCY87gY5gFXC6woALwFP0wh1m/B8h5IQ/HFE29YbykzSWz1WO6UzlZMNo21REsn9+QryNq0JuTc7DtW+r4KBcsuwKCPq90BwRANkmX2PtUoQ/HLDGSGgGXVWODYfxhYSSXl/+M0CxduwtT8p1sisni0pNtDcphxsBz2uBKHjcnOvCjICxQtCPTaa/9/PyesPSW62mdU/wi226aW5W29PgiF0j4dJpAy0CP+rIsBDwOIHW4sBVjaD4/K174EbA=; 25:XnM52HoPhULKRJi/PtZSpdioNE1Y8DD7ko7FyktkZP1lT4dsueOZPAx5ppxSXh4oZX31Tz6xeyyh4MUHGgWUW93QHP0omLEQmk0V8ikk38ySRY2c+qFnYpLywVWYXzmgF5tWVxoLna6t8aqqVqc0eYiuLLJ2oMxBS5zj5+56KorL+mNP0YFQPfCI00mxqSTkhXgORPpwQ21LFrWDPnfsKhjBmVDpkUHhfXkzk0t2lTzYah5n+d1kGn4KUBGPdISExjYWrBXZqMqxRAgbrf/Z5zRDGjupQqsCp8pJyqK6Y/ukNZDlykOsTpvEctN5tA++7feQCRcEZhCNDROZr00FcDhavrjdK/A8yD3AncCgX+0= X-MS-TrafficTypeDiagnostic: BLUPR12MB0417: X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 31:2sBtqDRWdIUfih8R3pHBUYCG8rp/dlcIutmwJIfv2KOmNOh7nf/KmZ4HiReBCI879f0rOCy+x/XLAydacDMBaC6I6pHNR2tW4SGtO1/EZ6nH3rfw4i7Q3g35UUse3NThcKo7epgbwKuL6Wdu795BiTevWb3+OeI78iQ6D8fFwUUgMkEQC4axSLNzcTzxM7HGbCeKyHd29sZFEjtOT8t4qI0OXHHNHd9n3/j8Ht6Mb1A=; 20:XPt95ULfKduH3y3hh9LCmst09MNbwghmp29L0XkuuZULzSFcG4z/co4oJA99tZM5AUm3dUTMuHrzfqfKKDE/6pnNg7q0FWkeVtJBmji7dGpmjMb/PegJ8bfuo78fUvd4b5JUXJWHtrpz5DMCegvMdemPnc5O1QP2lk5Zct+XPIxD6euq03qnNhxEjHUVUtjPenGyRj7pHqM3xfX1hjW4jApCk1yGIGtQh5hvMJnbOjfGec7JZdJ6kIaUl9dzedVGKPgV2Itf75ZEUZ2HNhlUXr00kKOPP4vaTLQ5lP3LdBUx59dP2smIc1hkUM1g19yWMgGjc1ZoKqPDoaE+WxgPOBRL1bgz/H5XxX93WncoEfLpdb6GiNGin9pChyLth4ApFEKfqWly9K7EIr0ea2BJudvwHaPZ5yNewRTU7qq54ruSD4V0iben14Et5rnL65DculjtDbxnTtCYxh2zkIOvxOArtRUZPQLQTP3K9YafeljJx6uFsg9FIFJC+Gm66SVx 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)(5005006)(8121501046)(93006095)(93003095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:BLUPR12MB0417; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0417; X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 4:saL+qr7/sYaI/tC7qohsKRNHQ/QlBwTBqdk6DUCwez+LkLPD69Gf8T2FVtgRyhFhbFFonV/p9ditH5tlgvda/M3kp6PnHimf4Y5cqkHs9tDBM5GE4lNb8GInReqpg57DrgP0P9q9v+XjttYDkYkTxb+b4qOisuWJnS6UwGJl8KygdsL4ArVZY/ti1h4QKbX61wI6XUHRBZgnmDyX3VkrN9a7bXMV+JpqczDt8DPzgaT7dk1lQNaDtz5JjxBLbo6KH9gK9VLwqzb0cauY3OyJ7FN5tNcO07b3VPGsT9bxwv1EpgcCN2wtpEilgTeuAqpZ X-Forefront-PRVS: 08296C9B35 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR12MB0417; 23:LWm2UeupFscXJmsamJoVR8ZpYVoPqc1TUYHl4w5EI?= U13Z92eoWfVaiJq9aCUN+cpLn+lsa+z+eQMcL/f0LWDPcDQzJWFcgLVsWAU9mT0CJk4r+2THbrEaOKCGqDb8jyO/lSB9Y1rR0AaYdrO1T4ehE1H46MzvTGp2GpWvjqJL6Ypao0ty9Ekin08nfWy3B0zWe+SxGNWlA7cjobw+vIb6sKs5lGk6rlGqcONdu6tT0GVl+AsgS5BfPDDUN7TDpBg0tnijvW5YeAQYIp1vjeUL3wwh7xiOVOD0HHiZD9I61r6ZkEsiXQrQgBNJWOi5hqOVYo59XX+PtZqFavEVCAhGgvW0ZjfXWO4a9XXvsO9Z3Mo1Ng+3DjweRep+zv5vWoReUB4Opb7CK0ARH+4u525HfLhM5WfyAAeMNGge9WxLkAzzLlQOsgv/0+UTRXU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: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR12MB0417; 20:jQ2Ye2BX0fryrfeSY9D10UrgC/FnNk8ml0vibhp5ZJfMrABx66Fjo37Vu0ojcRG52WFcyvaisCFzCbCLYMVMAOpLVX5RNWnoqXxs1L9xT264bWRnCJzbltRWIWrJNZHNbaZ6U4jvKJZfdwiJSFqpb0DlxLEP+iaMgMCeqvNIsmvvZAVzQK8MVrC7EPb0vcj2VpOPadUP31/TT2IwtPzZpvmfVHL9n2aSY5nbTAPp72TpTRuNwbWheKgr94qPfD5p X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2018 18:44:49.7871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8ea4695-1a74-4f12-7b2c-08d63529c8e0 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: BLUPR12MB0417 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 A ring might become unusable after reset, if that the case drm_sched_entity_select_rq will choose another, working rq to run the job if there is one. Also, skip recovery of ring which is not ready. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index d11489e..3124ca1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3355,10 +3355,24 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, else r = amdgpu_device_reset(adev); + /* + * After reboot a ring might fail in which case this will + * move the job to different rq if possible + */ + if (job) { + drm_sched_entity_select_rq(job->base.entity); + if (job->base.entity->rq) { + job->base.sched = job->base.entity->rq->sched; + } else { + job->base.sched = NULL; + r = -ENOENT; + } + } + for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; - if (!ring || !ring->sched.thread) + if (!ring || !ring->ready || !ring->sched.thread) continue; /* only need recovery sched of the given job's ring