Received: by 10.192.165.148 with SMTP id m20csp4798289imm; Tue, 24 Apr 2018 08:34:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48EdGILNDuiyLcbsLLn4CuZjhZ6zp4Q7BtUVEf7zKpUr+FoLG11Fj0z5tn6g82kLHEHIDUU X-Received: by 10.98.196.133 with SMTP id h5mr20661756pfk.86.1524584060815; Tue, 24 Apr 2018 08:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524584060; cv=none; d=google.com; s=arc-20160816; b=fDNO/ElIzOR9YP2gRR6Chj7ajjWcGqG2OniAe2M03MM4nqkke6WDVb/g7CJFADN5M1 xWY/EsQmX6apYUisRDjbea3Xe1yXGHUjyfco5jktNg6IAi0rl54rAU/pLaunBi8aclhH irXy+j0JCOQKsChVcKfhRSFucrn3JreAH0i1k6Z0whgL5QbMc4NcbgvRoMDnq8jUFa/m Bf6dGl+8PhY9AA3UDoTSzVvEgFNiqgFm6siy9soGfBRvoAC3CjK4YiEE7w2PQ+2tdut8 +/DwBx0inH/yo2lhqKLsfTx/PCjaxopnI/GWYeK8PuJM1f+7itHu7riBtOfr5reEDRSR aihg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=lJKStpsO2Vj+47lGFZpKh3HN0/Nm7jdro3TCCiohvFM=; b=ip9baDC+70AuuoWK4rrTEENh1bU/kiJjmTcXeFL52GPA6HwApI1yt1RVlHHVzFpaJd B+aMOUZ9XLFNS/gXRZ29w8EMkV3VKIdRao6n1gA61np8j9TAxl064affWoPbYFvCysEq o1U+pEQCFF8/M+rBmgjzHJS9KmfFIf6czWgSLpJjR+LHhs0PJ/UYYNUv5wFitcNW+Kar Im85ozVnNbfP/BrfdAnThAWMq6AIFAAiso4MJphNN50dEd8bPbKEGv5WWgqBKGt5oZUL zaDPDwDjkb2+Sgimm98/6rbgvhgQKPHEFWn0lVJYfDj6H3AtyG9nliATPaJBAx36eLWF Z3Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=aUWEyzf1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si9015839pgv.596.2018.04.24.08.34.05; Tue, 24 Apr 2018 08:34:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=aUWEyzf1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751829AbeDXPck (ORCPT + 99 others); Tue, 24 Apr 2018 11:32:40 -0400 Received: from mail-sn1nam01on0062.outbound.protection.outlook.com ([104.47.32.62]:25600 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750739AbeDXPci (ORCPT ); Tue, 24 Apr 2018 11:32:38 -0400 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; bh=lJKStpsO2Vj+47lGFZpKh3HN0/Nm7jdro3TCCiohvFM=; b=aUWEyzf1PK9233DyXXg2/AP3/OqU/ul+qlm+V6AE716QMTGOg0D4BNV/px3Ia7G5dAV3w7KX+vp5ZUzURH7cKD7lNxhedAz+R5BFE9VqzC1eMd8VSB9So3Z94IMErL4EvyfTGoWsoYcyyYoGFE298apCOdUuclPxdrB5N9rGyYo= Received: from SN1PR12CA0090.namprd12.prod.outlook.com (2603:10b6:802:21::25) by DM2PR12MB0332.namprd12.prod.outlook.com (2a01:111:e400:50d0::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Tue, 24 Apr 2018 15:32:35 +0000 Received: from CO1NAM03FT056.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::207) by SN1PR12CA0090.outlook.office365.com (2603:10b6:802:21::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.12 via Frontend Transport; Tue, 24 Apr 2018 15:32:35 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; linux-foundation.org; dkim=none (message not signed) header.d=none;linux-foundation.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT056.mail.protection.outlook.com (10.152.81.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.696.11 via Frontend Transport; Tue, 24 Apr 2018 15:32:35 +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.382.0; Tue, 24 Apr 2018 10:32:28 -0500 From: Andrey Grodzovsky To: , CC: , , , , , , Andrey Grodzovsky Subject: [PATCH 3/3] drm/amdgpu: Switch to interrupted wait to recover from ring hang. Date: Tue, 24 Apr 2018 11:30:36 -0400 Message-ID: <1524583836-12130-4-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524583836-12130-1-git-send-email-andrey.grodzovsky@amd.com> References: <1524583836-12130-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 Content-Type: text/plain 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)(396003)(39380400002)(39860400002)(376002)(2980300002)(428003)(199004)(189003)(44832011)(2906002)(486006)(26005)(8936002)(8676002)(50226002)(36756003)(47776003)(51416003)(54906003)(7696005)(53936002)(72206003)(106466001)(16586007)(476003)(11346002)(97736004)(110136005)(305945005)(356003)(81156014)(59450400001)(50466002)(77096007)(186003)(336012)(446003)(48376002)(53416004)(2616005)(5660300001)(76176011)(81166006)(478600001)(316002)(105586002)(6666003)(104016004)(126002)(4326008)(86362001)(68736007)(426003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR12MB0332;H:SATLEXCHOV01.amd.com;FPR:;SPF:None;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT056;1:wVuSgJ/ujF3iuErjdKDjcxpE4/m0IR/NQUzsz/LbMKwYiOylEO7pUf6FdTNjks3D4e+e1DtsLc8CXpimmduEFAoeRq+APd26HLHkuoLhjl29vMeGhdEFRHQfhkiuVhfR X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060);SRVR:DM2PR12MB0332; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0332;3:bkBmQ5EDtcnwBYGOUPhFgLVd0KXCXoVP5VCool0bhKMDHvPqP35OAmKRYJsJlPtfh7PavAWvP85qscDf3OtUmqrUxWhcDKuhAZWhgoKndBdokcQ1NfcpfWfWO3KdmAcPfXImcMlA/kPuUhlRHSB8b2/JPTnvqWUpau8++iijfJdUvpcbmws9UDTP9dNaxS1jT59kitVOocj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uhW3WTsmMfLIv3Kx08aW1fPS5qFvE4HMJyJ7J27OF5o/UmanAP2Hj9OQK0AGMCPVyMDjpbwpEQ6zg6MdLVYRIdJu2QZhg96FMVE46jGaOOvEMu8+JfhnFYt6L4Lg+RayOrxl2CrWnmVsuwpDXo+9MIl9G5P3YoNQUVUmvuo6EMgq3Wv1J6O3E1Gn+BYsePTe/jRVN1d1rW7Gt+JhsJrA2lf0eqIT53+wtnsFbs8aZtmtP1nUfam9bP0dtb/d X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93003095)(3231232)(944501410)(52105095)(3002001)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011);SRVR:DM2PR12MB0332;BCL:0;PCL:0;RULEID:;SRVR:DM2PR12MB0332; X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0332;4:A1sQidw6VKjAjeeietadw0Fg9UPBU/H/9gDzL2E6mpcye8fkxEBbWVLwznVx+gnoZQzceXqWq51qUl+W462J8ivViYWWoqTI+G1s9GZcvAF9lhkcpzQFBydOADI2gG27+iKYE9r2ASEgf8bZJNmfLFQPAYtdQ/bDuqS59xsRaheWlGXxVX0GlUl/glsw3rr2uw/iV6UipKX51t686p+TilFb/CJQshUNuZD4lJZ3ji6MY61ZaSFXEju3e63PdSlD8kjFVxoPS3owA5zTNhRYCnwB+8FdzfS7NIG3oWvQpXAoq4KcQmRBBv9W8Da17KvM X-Forefront-PRVS: 0652EA5565 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR12MB0332;23:OvVmSjJIgGKKOOOwe/QVdDnVOMVf7lNiltoBV3nxc?= =?us-ascii?Q?4b6RNvgl1IH+XPR8tHpokKe3mxpfXEf/H5Tj0t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g45yvhvgj9GpGGTsGbhGPDJSXZ1etXpRqiof7dVbHrn00PK6MrZYW70H0Y3gpS3hLU/36vIQy1cXIrNPQcBbap828J6d7+7qu/UMifhUYxhH6V8wt9RJ7DmbaBpZ1YYNbZrdfuwxnGs4=;24:tl7VAe/hKyMuwBDE4iSCbCBYZh7xCpfIOJe9V21n1yfl9I1+mrUoeN12ogICes3206JXd4OsBaXUvt94JhnHMhc6tpnbOIlg65oWrTxBa0w= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM2PR12MB0332;7:h+p1Ux8QggXPM7pM9rS8lDvKSA410ZYbV15zpZ607Rj62tU5rqSUt0UY+K7mz1+IhfYDLXEgebzdo2O/aHZWNlHoF7131m5tjpkmA96lrKeXWlynlT3DB+rGzeSjk7UbpFUDhw8WEx2mjoaxBdsd3uKV7iz00tU1FvrXAAF6Ent1+455mIU9AxoSWg6fLUdHG1AM2qfCUee47QsXmgH2DFeb2mIDVHw+MnpME4byXVgjNBq4bKeHw5Y3iRSTXxO+;20:YmSKgkMPR3K3B189xFkoH0KBjuU89fU3dxnFOj7OmemaW08gA8B8HvQaXW0lcRo9/bEOWUlyS142aR40uLJlvIQlqCd96atGsGIsbtUCqDgX/6FhVtI/m+CHnLJzsanI4meUc4zTsCuLDe2xm10EDA9j7KSCoHJHdVQ35PDTcVEmdApSFKvCLtkq98NVc6mMDgwK7npyAPc5Okjf//4EPYFjm5bDMdgjbPCRPJ7d3Y9spTXfghG72YIza4u25Zkn X-MS-Office365-Filtering-Correlation-Id: 22f329bb-8cd7-4b60-aedd-08d5a9f89aa3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 15:32:35.1382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22f329bb-8cd7-4b60-aedd-08d5a9f89aa3 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: DM2PR12MB0332 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If the ring is hanging for some reason allow to recover the waiting by sending fatal signal. Originally-by: David Panariti Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index eb80edf..37a36af 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -421,10 +421,16 @@ int amdgpu_ctx_wait_prev_fence(struct amdgpu_ctx *ctx, unsigned ring_id) if (other) { signed long r; - r = dma_fence_wait_timeout(other, false, MAX_SCHEDULE_TIMEOUT); - if (r < 0) { - DRM_ERROR("Error (%ld) waiting for fence!\n", r); - return r; + + while (true) { + if ((r = dma_fence_wait_timeout(other, true, + MAX_SCHEDULE_TIMEOUT)) >= 0) + return 0; + + if (fatal_signal_pending(current)) { + DRM_ERROR("Error (%ld) waiting for fence!\n", r); + return r; + } } } -- 2.7.4