Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3539744pxb; Mon, 4 Apr 2022 20:29:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTl6MeivuuunPHHRKtWenimOgEWM1RUM44H+uXUB84KoPHuPriJkNPdu8fdQnmBG5ldk6T X-Received: by 2002:a63:fd4e:0:b0:399:3005:d0e0 with SMTP id m14-20020a63fd4e000000b003993005d0e0mr1174244pgj.276.1649129369647; Mon, 04 Apr 2022 20:29:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649129369; cv=none; d=google.com; s=arc-20160816; b=E17EJKiLM36j+4oBbmEFEoVdC75N3aX91mtRNaXjabwACY0Lpigj6O+09lYBqhr2IX OM9s/IeDGvXNkW34APXUwXmHOFWI5g29u+Cek7DaaJ/57v4p/CHrrw78YqwQkQWlIEuJ ag350QQgoSQRe6rBQ3fydPQP/aLVJP2EixCrovynKE1uF/DAcPAu4Gq/+clPedMgPMDD lwS3svEq1ws/b/M3lPzRzM7pPqHTYUk1GIRDm3Jrs5Ff67nNfHbwWLzqFgfD/LHbHgt3 LfT0IO+YxkBkTf8Nba1Z3Wvryi6WJYG2PKLlbfmx5o30htCaVnf+brM3Nl9VV72N/CQE keCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=INa29OqobDWfbNUdSvKkp0BobPaBPqtKqxsAvgv+bAM=; b=Hee9xb8bO/0uWcymdpVHwvaCEVysZS/m0tk+7L7sdOP3v9USetOOGlkEYN1krvfHkK tIdZLfGM6d8N6USoy+JousViD5cHom7TSNcZwjZjoEkg5f4dNbgBp3uNT/4VIcl6M+A1 2VHt3bWeCF9n8NLiEv6Ndfs1fgnSPBdDnW9jTPmBvaBdf9EhMWLDuvTwZ/ePARMd1YVG 36SFKKkvlAp24SbpSkWVHaq+jb96WbLgwx63n5pkQwTWxxsOqKFAgeRh+RuvN8adbL6/ JMP/nhnxAnPZHcTEiJgDBU/mPu6lojL4ErEGZHvbk49FNRfzVYoQAkDmEU5UzA3gxdTv gWWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KP3AbLei; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i71-20020a639d4a000000b003994c58fe83si2344053pgd.143.2022.04.04.20.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 20:29:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KP3AbLei; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E50F5336CB8; Mon, 4 Apr 2022 18:28:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346912AbiDAO2f (ORCPT + 99 others); Fri, 1 Apr 2022 10:28:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346978AbiDAO2T (ORCPT ); Fri, 1 Apr 2022 10:28:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B6A92856A4; Fri, 1 Apr 2022 07:26:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D816FB824FD; Fri, 1 Apr 2022 14:26:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66420C340EE; Fri, 1 Apr 2022 14:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823182; bh=4cQFOGC321tZUM5kmqe8vJLMcu83UtVRJLbTIIHfQT0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KP3AbLeiW4jACv7S6UfA2h0GhbyBx1V4GX1sKkxzhQcaV+yq3Mz52mK4jLu1+5wOC v7ICr0wWoN2f2NSn4ingDdDwnCmtUzu3euOE7TFL0EWUvEsTrxa74xAY40UBI6v46w I1Y3CgGdODbPrA/UECdyMaHUW620XgD8NlcHcCyDFZaOF0lXloC4X3cPidBWkmd2B3 QX5GqfhIkzU+P9CK9kG0XCzTLk5lNy76w3386PyDvd3yVuCKSDhAjl20pyPpJZO25B n834j/Hq1JvPzMMA1eQitVZkcH1i1QpQINh4ZIKvNrOUDreJdvDCpfzYc3go12Q7St aaH/vqd9HK7sQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Kazlauskas , Daniel Wheeler , Anthony Koo , Rodrigo Siqueira , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@linux.ie, daniel@ffwll.ch, roman.li@amd.com, mikita.lipski@amd.com, robin.chen@amd.com, pulehui@huawei.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.17 013/149] drm/amd/display: Use PSR version selected during set_psr_caps Date: Fri, 1 Apr 2022 10:23:20 -0400 Message-Id: <20220401142536.1948161-13-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Kazlauskas [ Upstream commit b80ddeb29d9df449f875f0b6f5de08d7537c02b8 ] [Why] If the DPCD caps specifies a PSR version newer than PSR_VERSION_1 then we fallback to using PSR_VERSION_1 in amdgpu_dm_set_psr_caps. This gets overriden with the raw DPCD value in amdgpu_dm_link_setup_psr, which can result in DMCUB hanging if we pass in an unsupported PSR version number. [How] Fix the hang by using link->psr_settings.psr_version directly during amdgpu_dm_link_setup_psr. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c index c510638b4f99..a009fc654ac9 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c @@ -149,10 +149,8 @@ bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream) link = stream->link; - psr_config.psr_version = link->dpcd_caps.psr_caps.psr_version; - - if (psr_config.psr_version > 0) { - psr_config.psr_exit_link_training_required = 0x1; + if (link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED) { + psr_config.psr_version = link->psr_settings.psr_version; psr_config.psr_frame_capture_indication_req = 0; psr_config.psr_rfb_setup_time = 0x37; psr_config.psr_sdp_transmit_line_num_deadline = 0x20; -- 2.34.1