From patchwork Thu Apr 16 13:24:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 227785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29254C2BB55 for ; Thu, 16 Apr 2020 14:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECEA221734 for ; Thu, 16 Apr 2020 14:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587045621; bh=WS83ZMqbmaiP+n7ZUVBZyuzfyW0XaIhuQfMBGWKJQ+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VUk+TCHkyDSAfcAhsfb4tKp2adf+KVTlhzSofD9Cimsa/MTi0nwt0WHYKZmBl/OeW r9roElg68+tMmeraPSJt4hfVIyemYT1FBNyqhAszw7E/PpjXqnE5LKCZ7QFyxdKyFf +tPDXO/5sLLkBNwdcK0AoXQctXb4ijP1L8WAtc4Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391788AbgDPOAS (ORCPT ); Thu, 16 Apr 2020 10:00:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:47316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730047AbgDPOAQ (ORCPT ); Thu, 16 Apr 2020 10:00:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E3D620732; Thu, 16 Apr 2020 14:00:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587045615; bh=WS83ZMqbmaiP+n7ZUVBZyuzfyW0XaIhuQfMBGWKJQ+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o570yroOUnw40nG5DsiyKymJqWdFMTctBFBrXfXJT1hT1JjqFS2B0Ng6oCFiw3YJG kKyabNu19ppktHTABog0Ch8WsYWw3Q3V1QwdMn/OXOSMlkZDX/CzbmKe42uEF4WCUX zeRP4oLS9UdBsgYEsAnUUlC6/myzwqDASOMZgla8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Strauss , Eric Yang , Rodrigo Siqueira , Alex Deucher Subject: [PATCH 5.6 207/254] drm/amd/display: Check for null fclk voltage when parsing clock table Date: Thu, 16 Apr 2020 15:24:56 +0200 Message-Id: <20200416131351.945784577@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131325.804095985@linuxfoundation.org> References: <20200416131325.804095985@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Michael Strauss commit 72f5b5a308c744573fdbc6c78202c52196d2c162 upstream. [WHY] In cases where a clock table is malformed such that fclk entries have frequencies but not voltages listed, we don't catch the error and set clocks to 0 instead of using hardcoded values as we should. [HOW] Add check for clock tables fclk entry's voltage as well Signed-off-by: Michael Strauss Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c @@ -643,7 +643,7 @@ static void rn_clk_mgr_helper_populate_b /* Find lowest DPM, FCLK is filled in reverse order*/ for (i = PP_SMU_NUM_FCLK_DPM_LEVELS - 1; i >= 0; i--) { - if (clock_table->FClocks[i].Freq != 0) { + if (clock_table->FClocks[i].Freq != 0 && clock_table->FClocks[i].Vol != 0) { j = i; break; }