From patchwork Tue Apr 16 18:23:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10903749 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 670CA161F for ; Tue, 16 Apr 2019 18:23:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5483428988 for ; Tue, 16 Apr 2019 18:23:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48647289C4; Tue, 16 Apr 2019 18:23:35 +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 F418828988 for ; Tue, 16 Apr 2019 18:23:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFFB589CE1; Tue, 16 Apr 2019 18:23:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780084.outbound.protection.outlook.com [40.107.78.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29EBE89CE1; Tue, 16 Apr 2019 18:23:33 +0000 (UTC) Received: from CY4PR12CA0042.namprd12.prod.outlook.com (2603:10b6:903:129::28) by BLUPR12MB0580.namprd12.prod.outlook.com (2a01:111:e400:594f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.15; Tue, 16 Apr 2019 18:23:31 +0000 Received: from CO1NAM03FT050.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by CY4PR12CA0042.outlook.office365.com (2603:10b6:903:129::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1813.12 via Frontend Transport; Tue, 16 Apr 2019 18:23:30 +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 CO1NAM03FT050.mail.protection.outlook.com (10.152.81.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1771.16 via Frontend Transport; Tue, 16 Apr 2019 18:23:30 +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; Tue, 16 Apr 2019 13:23:28 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH v4 2/5] drm/amd/display: Use a reasonable timeout for framebuffer fence waits Date: Tue, 16 Apr 2019 14:23:03 -0400 Message-ID: <1555438986-18303-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555438986-18303-1-git-send-email-andrey.grodzovsky@amd.com> References: <1555438986-18303-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)(136003)(396003)(346002)(376002)(39860400002)(2980300002)(428003)(199004)(189003)(105586002)(6666004)(8936002)(86362001)(81156014)(81166006)(97736004)(5660300002)(14444005)(2201001)(76176011)(8676002)(50226002)(106466001)(356004)(77096007)(47776003)(53416004)(26005)(68736007)(126002)(48376002)(316002)(2616005)(476003)(50466002)(44832011)(336012)(446003)(486006)(110136005)(16586007)(426003)(54906003)(11346002)(4326008)(478600001)(7696005)(72206003)(36756003)(104016004)(53936002)(51416003)(305945005)(2906002)(186003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0580; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 332f8843-eb25-4580-c4f0-08d6c298a08e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600140)(711020)(4605104)(2017052603328); SRVR:BLUPR12MB0580; X-MS-TrafficTypeDiagnostic: BLUPR12MB0580: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 000947967F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: W7RmeQVPw85bo69IVAwRON4oMOWOT2I5BteSK+VqhRjYyB1bm92dmA33t4G7BiwAkhfxv0Id3ypiCTrwfn1dHdjH8d9724aAym3Pg39sysjnTpEJ0jrYf9U0RU0MislL94vwwJr7Edu+nfA7D3ygFs5weGo2K0LzCWRTp3g+bsqkMMSiIBe6JCaNxAu/zjbWZxsd4mhp+L4GB+LyHuJzctV93REm1Fn4RTVkTT2wN/MKgtG9qLXryhzOx84ZCUJSBall+8179874IQ6pQ80VQcd/fZICyy0uzzl7tSz4zJtUmhgsSCqoC3J43FO4uGOHR3NYYtYXIkJhxKGdDbwIo2l+CPERdKHNwQRyLhr6kPm2M+h04XmljLrUrzOU3olqpFZH5LKBHntS4luYIASt4H713slw3Vu0zS8c2RWumXo= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2019 18:23:30.1120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 332f8843-eb25-4580-c4f0-08d6c298a08e 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: BLUPR12MB0580 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=P9GbvaP8VeAAnoe3WOwqqIG4cb4JuDC7xCnCw6LeA9k=; b=e0JdUhVluUpAIzd8irL1mOJA1ogSADWO2Dk4oA3ljNc5h1RXtSOtlehoME1Z7/Guv9I4iFNZsIwregcGot1dQrLjJZRnlTseC/BWgw3HVrVLP9HWcDK0991SYk4oot8t9lIh0iAKpliM/ugK0YdbIkEj/77ajwU2yftJZ4qs41U= 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. v4: Update description. Signed-off-by: Andrey Grodzovsky Reviewed-by: Nicholas Kazlauskas --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 +++++++++------ 1 file changed, 9 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 ad4f0e5..88e42ad 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -4816,11 +4816,16 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, abo = gem_to_amdgpu_bo(fb->obj[0]); - /* Wait for all fences on this FB */ + /* + * 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, - MAX_SCHEDULE_TIMEOUT); - WARN_ON(r < 0); + msecs_to_jiffies(5000)); + if (unlikely(r <= 0)) + DRM_ERROR("Waiting for fences timed out or interrupted!"); /* * TODO This might fail and hence better not used, wait @@ -4829,10 +4834,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, * blocking commit to as per framework helpers */ 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); - } amdgpu_bo_get_tiling_flags(abo, &tiling_flags);