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:XnM52Ho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RTU7qq54ruSD4V0iben14Et5rnL65DculjtDbxnTtCYxh2zkIOvxOArtRUZPQLQTP3K9YafeljJx6uFsg9FIFJC+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+vIb6sK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liH4csouirwZOWBqqFMlm/Pwqp9HlsFN4eIjRYjGSzdC7pTSHRNJlJedGDuNADSpSSMyql3I2krq4VUe7Wiwd1QBl4CRxPj7fblNtBwVn7EeqGFVULHpg7/aVCkWhzUGLSRVR/M7EUq7lEJ5VqKTF/VBd3NCpEmnLn1EsIYB6EcXwzx6ZA1+UAQch5xeU4U6iMHfbGMN6SRvKUPgbzyWA3djIDC SpamDiagnosticOutput: 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