Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2139935pxb; Fri, 5 Feb 2021 09:51:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNrPJ490w7oJDQhEq+k6HjL1trcqJJ9KgU4dDiMq7/jm019675CqRu/HVs/oOvfB2LFdbo X-Received: by 2002:aa7:d489:: with SMTP id b9mr4701624edr.374.1612547463761; Fri, 05 Feb 2021 09:51:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612547463; cv=none; d=google.com; s=arc-20160816; b=nPJ5LgS/8A5qbMO928UGknyB1gexU7D7EyHvvGPbVzJ5BvWc4Eso4mf09VFqGwXNHi RGVnXM8C1YpGJSPVWomFaNoFEHKpoPn0n/Zv3f+o9NLBb0cqawhllmJ4P0AWioKqhlbU SGYyVtYICFuD82sCmKhytgU6Y7sGua7b2qJMcuRSq6eVczVE50aS5XTbUaNVYtB0T0p7 2h9nRimxtJ+4bFQnTVopooq04uthAypyfjm8IMo0Yg7uYXBVlO0JEwpYgppytj5neYLB ej5SHnOZbXutYzulSFwvgyxN4bfsxdG2Skp/LCkVYMQhdoKcx+bNRQg+KjPFc5XJ77FL VD+g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5GiLi/pxx59hQfj45FBgz9ayN7xG4FO3DmUdYVR4KDo=; b=dREal9xu/nzSXuuuP+AYj9poJhP9IPcaSUN4rron6CPnw7M2cYncsmWO3lLnk2cbwF vYq4ZVMmvZXMYxsi8gUXp8Zpwm5/8tfNbmk/5Fe5ow//PdzDGEVdbFfzf4PE+OxJ5aCj HL2c1jmWvlMNAhEuY0E7X73fsMCLSmV1zgPbSKx2eHwENZ5hBfzQ+MbV5TYjboeLXuy+ vTfwEhEZOKCsuyy1MhTNNFACmczlSnD0FbM0O/gVIvIiwrLeGNQlqXYNAlNeR8xoFYX/ 00oX1BrCD3h6qixC4WPduofqkRafbIVCeGfoSuoXYRpOih+vmyx6dqca8OvClg7C6b5m ftMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b977jaWg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si6204487edq.484.2021.02.05.09.50.36; Fri, 05 Feb 2021 09:51:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b977jaWg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232657AbhBEQHI (ORCPT + 99 others); Fri, 5 Feb 2021 11:07:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:53906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233497AbhBEQBY (ORCPT ); Fri, 5 Feb 2021 11:01:24 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 317D46506C; Fri, 5 Feb 2021 14:12:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612534374; bh=uwFvfc6L4wpnKmbVy14n1pGZETZp9bDsqif3aF84e58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b977jaWgUz0ek9I20QieC5A0NmM7dJEo+HtCez2Y3v5iysueVRTupKrd2ltKQSsBq JoRlDoT3It4E41t+Y+Jh4JhZno6hn5hOnunU6n/dUWyl/XAvTuy8vQuqLTAnVOfd1V yYaLN7PAc6GTd7FQqEfk4sHg1FtZyhgqtH1DWOyo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Wheeler , Bing Guo , Jun Lei , Anson Jacob , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 29/32] drm/amd/display: Change function decide_dp_link_settings to avoid infinite looping Date: Fri, 5 Feb 2021 15:07:44 +0100 Message-Id: <20210205140653.578210069@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210205140652.348864025@linuxfoundation.org> References: <20210205140652.348864025@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bing Guo [ Upstream commit 4716a7c50c5c66d6ddc42401e1e0ba13b492e105 ] Why: Function decide_dp_link_settings() loops infinitely when required bandwidth can't be supported. How: Check the required bandwidth against verified_link_cap before trying to find a link setting for it. Tested-by: Daniel Wheeler Signed-off-by: Bing Guo Reviewed-by: Jun Lei Acked-by: Anson Jacob Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c index 959eb075d11ed..c18f39271b034 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c @@ -1914,6 +1914,9 @@ static bool decide_dp_link_settings(struct dc_link *link, struct dc_link_setting initial_link_setting; uint32_t link_bw; + if (req_bw > dc_link_bandwidth_kbps(link, &link->verified_link_cap)) + return false; + /* search for the minimum link setting that: * 1. is supported according to the link training result * 2. could support the b/w requested by the timing -- 2.27.0