From patchwork Thu Apr 11 16:03:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10896373 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 833B9922 for ; Thu, 11 Apr 2019 16:04:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DEEA285AA for ; Thu, 11 Apr 2019 16:04:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6204028B61; Thu, 11 Apr 2019 16:04:20 +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=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 13844285AA for ; Thu, 11 Apr 2019 16:04:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B53EB89150; Thu, 11 Apr 2019 16:04:18 +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-eopbgr770053.outbound.protection.outlook.com [40.107.77.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBD0789147; Thu, 11 Apr 2019 16:04:17 +0000 (UTC) Received: from SN1PR12CA0093.namprd12.prod.outlook.com (2603:10b6:802:21::28) by BY2PR12MB0581.namprd12.prod.outlook.com (2a01:111:e400:52dd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Thu, 11 Apr 2019 16:04:15 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by SN1PR12CA0093.outlook.office365.com (2603:10b6:802:21::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.17 via Frontend Transport; Thu, 11 Apr 2019 16:04:15 +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 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.1771.16 via Frontend Transport; Thu, 11 Apr 2019 16:04:14 +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, 11 Apr 2019 11:04:11 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH 4/4] drm/amd/display: Restore deleted patch to resolve reset deadlock. Date: Thu, 11 Apr 2019 12:03:44 -0400 Message-ID: <1554998624-25799-4-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1554998624-25799-1-git-send-email-andrey.grodzovsky@amd.com> References: <1554998624-25799-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)(376002)(136003)(346002)(396003)(2980300002)(428003)(189003)(199004)(81156014)(4326008)(81166006)(8676002)(7696005)(50226002)(77096007)(51416003)(6666004)(356004)(2906002)(186003)(8936002)(478600001)(53936002)(68736007)(76176011)(486006)(53416004)(104016004)(11346002)(47776003)(2616005)(476003)(16586007)(126002)(14444005)(316002)(44832011)(110136005)(26005)(54906003)(305945005)(86362001)(5660300002)(426003)(2201001)(48376002)(97736004)(336012)(50466002)(106466001)(72206003)(446003)(105586002)(36756003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0581; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bc31f1bb-d9b7-4239-3b53-08d6be97585d X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328); SRVR:BY2PR12MB0581; X-MS-TrafficTypeDiagnostic: BY2PR12MB0581: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00046D390F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: QfCnrj6dIMP6avcxop1eakZNfbXBAgHxEijAdEr6liB0qDZCgwT1/9YugYaRkFIqnX+3ofsesm/ZkJQnH/N6IYmP7Hnv5hSyBaWVYNVCrZZDHBZuhX8I9cHLyGHfFet6wgC2XeZg+nasI857k6kLhliObQ74UCO2/Y0KW3doCY0/2V2xH2qP++qXutL4kIydW0z01EHnFr6lRlWvvuZhsHD8sbfuVKCvv69G1wo03KLW8oqunAgUpnJi85qA07vYxmN+Wx1sqJ0Sa1L4743UugTfMWizSbswDjqPiEl+x180kkeyNOFzGiHBezs5lQcwsR8ZmKoIOEQSrRxtCsIcXpcSr2eBO/nz4F03fnOOTXE0G8YSQBA5wdoG2bdYNhiPDx+ZhtTgxV+znbvvUQ9jqFds3a5ygbt6br04fv8SJ54= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2019 16:04:14.8979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc31f1bb-d9b7-4239-3b53-08d6be97585d 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: BY2PR12MB0581 X-Mailman-Original-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:X-MS-Exchange-SenderADCheck; bh=oZ/TbQI6UrPvpr83SHingNTscyMBlJ/7MpihmwDsdD4=; b=r/vkftFDNL4+mLvjVl3DeFoD1LiR2IIdsc4/jMVKC+B/ORuUZpw1raralhJhHXMSN3/r+PfmFMZtAiCFxMGA+UhKbBZ1e+gTAdDPQoI0SyGFo3+FUnGNZ/eYwQVfcN2xmS80ed6T1qO2oi13UJ+a/TG2tBUucnhgJQHgKrj0Wos= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; 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: Nicholas.Kazlauskas@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Patch '5edb0c9b Fix deadlock with display during hanged ring recovery' was accidentaly removed during one of DALs code merges. Signed-off-by: Andrey Grodzovsky Reviewed-by: Nicholas Kazlauskas --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 0648794..27e0383 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5138,14 +5138,21 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, */ abo = gem_to_amdgpu_bo(fb->obj[0]); r = amdgpu_bo_reserve(abo, true); - if (unlikely(r != 0)) { + if (unlikely(r != 0)) DRM_ERROR("failed to reserve buffer before flip\n"); - WARN_ON(1); - } - /* Wait for all fences on this FB */ - WARN_ON(reservation_object_wait_timeout_rcu(abo->tbo.resv, true, false, - MAX_SCHEDULE_TIMEOUT) < 0); + /* + * Wait for all fences on this FB. Do limited wait to avoid + * deadlock during GPU reset when this fence will not signal + * but we hold reservation lock for the BO. + */ + r = reservation_object_wait_timeout_rcu(abo->tbo.resv, + true, false, + msecs_to_jiffies(5000)); + if (unlikely(r == 0)) + DRM_ERROR("Waiting for fences timed out."); + + amdgpu_bo_get_tiling_flags(abo, &tiling_flags);