From patchwork Mon Apr 15 19:43:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10901481 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 CCBD914DB for ; Mon, 15 Apr 2019 19:44:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4BC228942 for ; Mon, 15 Apr 2019 19:44:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A92E028956; Mon, 15 Apr 2019 19:44:02 +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 6132D2894D for ; Mon, 15 Apr 2019 19:44:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0810789916; Mon, 15 Apr 2019 19:44:01 +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-eopbgr770050.outbound.protection.outlook.com [40.107.77.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB3A18991A; Mon, 15 Apr 2019 19:43:59 +0000 (UTC) Received: from MWHPR1201CA0012.namprd12.prod.outlook.com (2603:10b6:301:4a::22) by BN8PR12MB2962.namprd12.prod.outlook.com (2603:10b6:408:61::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Mon, 15 Apr 2019 19:43:57 +0000 Received: from CO1NAM03FT015.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::204) by MWHPR1201CA0012.outlook.office365.com (2603:10b6:301:4a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1792.15 via Frontend Transport; Mon, 15 Apr 2019 19:43:57 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.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; Mon, 15 Apr 2019 19:43:56 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Mon, 15 Apr 2019 14:43:54 -0500 From: Andrey Grodzovsky To: , , , , Subject: [PATCH v3 5/5] Patch '5edb0c9b Fix deadlock with display during hanged ring recovery' was accidentaly removed during one of DALs code merges. Date: Mon, 15 Apr 2019 15:43:23 -0400 Message-ID: <1555357403-30813-5-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1555357403-30813-1-git-send-email-andrey.grodzovsky@amd.com> References: <1555357403-30813-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)(39860400002)(136003)(346002)(396003)(2980300002)(428003)(199004)(189003)(5660300002)(356004)(110136005)(68736007)(6666004)(316002)(53936002)(16586007)(54906003)(2201001)(7696005)(51416003)(2906002)(186003)(104016004)(4326008)(76176011)(36756003)(81166006)(72206003)(8676002)(47776003)(478600001)(50226002)(53416004)(105586002)(26005)(86362001)(336012)(106466001)(77096007)(305945005)(2616005)(126002)(50466002)(11346002)(486006)(8936002)(446003)(97736004)(48376002)(81156014)(476003)(44832011)(426003)(14444005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN8PR12MB2962; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d30a17e6-93ee-45fa-7d01-08d6c1dab301 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328); SRVR:BN8PR12MB2962; X-MS-TrafficTypeDiagnostic: BN8PR12MB2962: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 000800954F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: fIAU/Yu/37RE8DDhmh0KXN9nEELCoene6V8XU8dnu6qeC8eoVeudzdJzQckFFe6yPGgBApjBCLTMRA7CZWB3Vf2yDdrU6DX8ineL83azkGJePuUnYEQbcvDtq9X8n7ZYMGm/+6cIPyZJwqKSLO9b9dnzDJSgJ/tQ5RlAh28GobqF03U4VTuwKQrdIB9y8nGsCPsQwgBCHpFzxuy/IQt16JYsSQJV06cFdtd2/I1ZZb6Q4qd7suPS4ICe1NszPAJROgs6z35noQUZsxTQPRBHS0YKjcSX37TmLtC5QwvKd9gOoqeIphc0HbxkpH13/6JDMsEsmtLxb59L3hSUm+oOICkMl1R576f7ckJ54R3UMeW8d8glh+ApzGu/QQYQCycrKtrKbHdfs1Z17vbhi0+Qh33i6dc20F/PDTGT1VNzYFM= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2019 19:43:56.7557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d30a17e6-93ee-45fa-7d01-08d6c1dab301 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2962 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=gx0RE1L4IgDT/NUYSqahAZDAt2ljsUnkBFgN6uAyFr0=; b=kU9kwnQK/dI9QnkKKmtMwc1hpWTGAAFVDVfiOKnbQypuRG+GDsCBcmWQLEYH+yjlbSqm5TBsXbdAortVXMPnEpNLQqOiatc0DoOldpnFkXhybghy9PMWi4g0yhsQXtt7mshewYOk5pm8D8ZfNe6FxCdeS6KiEj47fCG7uq9VxVE= 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 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 5aeac2c..2bae2bf 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5297,11 +5297,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 @@ -5310,10 +5315,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);