Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp860969pxx; Tue, 27 Oct 2020 02:12:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGXYGCVhDPxIQ/OQsN/HBYjJzikcEkAj4QQBvdCg2tkT41ZEwDz4z6p72spE3iztPAGTpZ X-Received: by 2002:aa7:d9ce:: with SMTP id v14mr1172008eds.203.1603789937430; Tue, 27 Oct 2020 02:12:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603789937; cv=none; d=google.com; s=arc-20160816; b=rKL+jsQZtx1HNnmrscjE/P7N8eMNgx3FRx+ZKoB48VoG9Y5x9RgQ+et1JIRpmQdeBG AtT9ZsmHSOuWKAHP9x+zS3je+0AoRBlPD4ELOl1CwKM61XQF1k1fdmJa07yoK8Z0En7B v2auxtb6ReT4HEsQEIbdTMIp+DWvZHBzKgF9zG9FZGKa+nu2mTy/EW5phF1aQ7QP2bl8 iMCOTKY7UCr0R4BhwPLFvGz+5dZHh7g8VVJ1Ueu//K1iPWMfVZMC8ql5Nn8fvi0/7mvS m9eSc8guitMi/1xpxPbniDWuaIZ75pGBQjVoEbPMltt/Gxlb6G1WIaVjJhUjDTI+79Fn bltQ== 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=7Nwxiko4prdS7F2ZUtajVPY5VLLlvhMie5v8k3agfDM=; b=RoxB8cqsQQbyd+i+LTsbbwQ9uviilCF3x3WiVoIXWdAtq5LwtZitL9AC5rnSRnVIY7 2aA9bQzp92GL1CV7uhqk0UUJIUNOn1gIRHtsLXCbLN1B2SpDCSAD/fkuTtj4PHNR1BZW rqvxK/A4DsLDalVNyh6EnB6pZySvqH/A9ZUz5FnVx605KxHwQ5ixJBFRc0jduoh9DK2G wGB8frMbEs7mSa1k/pBtB+07l6XHgtLYIZYq2I7VGKyxYguaElZBhafUbPWzgaV1Za4A jzJc17H65L4Md9xKIQTu/N6mMaz/M1eFPN5wTeM64DD39rIZFovQ/weMHOffxjhp+hZr b83w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yJ2v1KQZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si413030eds.554.2020.10.27.02.11.54; Tue, 27 Oct 2020 02:12:17 -0700 (PDT) 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=@kernel.org header.s=default header.b=yJ2v1KQZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409288AbgJZXvB (ORCPT + 99 others); Mon, 26 Oct 2020 19:51:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:50106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409131AbgJZXud (ORCPT ); Mon, 26 Oct 2020 19:50:33 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AD0EE216FD; Mon, 26 Oct 2020 23:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603756232; bh=5SwOcDG6zpmV/M7GZH/CDE9DdYD5oGCjxlb8cnRuBac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yJ2v1KQZIpgv6OwuPY3gsmxilbcqFwXfRbC/8iCWE78Kh/s0a2GVnoiifqAsTwH6t Wth2K5+BJaeqHNBOguKv7EFXOhxTRzJ4otbHaThlZrQv0o+h5xMAU/6m1ObGpVkXlV SvHytwnR576G8r9ogGw4Pan+644VtaOT36VZ+/cc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rodrigo Siqueira , Aurabindo Pillai , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.9 070/147] drm/amd/display: Check clock table return Date: Mon, 26 Oct 2020 19:47:48 -0400 Message-Id: <20201026234905.1022767-70-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201026234905.1022767-1-sashal@kernel.org> References: <20201026234905.1022767-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rodrigo Siqueira [ Upstream commit 4b4f21ff7f5d11bb77e169b306dcbc5b216f5db5 ] During the load processes for Renoir, our display code needs to retrieve the SMU clock and voltage table, however, this operation can fail which means that we have to check this scenario. Currently, we are not handling this case properly and as a result, we have seen the following dmesg log during the boot: RIP: 0010:rn_clk_mgr_construct+0x129/0x3d0 [amdgpu] ... Call Trace: dc_clk_mgr_create+0x16a/0x1b0 [amdgpu] dc_create+0x231/0x760 [amdgpu] This commit fixes this issue by checking the return status retrieved from the clock table before try to populate any bandwidth. Signed-off-by: Rodrigo Siqueira Acked-by: Aurabindo Pillai Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git 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 index 21a3073c8929e..2f8fee05547ac 100644 --- 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 @@ -761,6 +761,7 @@ void rn_clk_mgr_construct( { struct dc_debug_options *debug = &ctx->dc->debug; struct dpm_clocks clock_table = { 0 }; + enum pp_smu_status status = 0; clk_mgr->base.ctx = ctx; clk_mgr->base.funcs = &dcn21_funcs; @@ -817,8 +818,10 @@ void rn_clk_mgr_construct( clk_mgr->base.bw_params = &rn_bw_params; if (pp_smu && pp_smu->rn_funcs.get_dpm_clock_table) { - pp_smu->rn_funcs.get_dpm_clock_table(&pp_smu->rn_funcs.pp_smu, &clock_table); - if (ctx->dc_bios && ctx->dc_bios->integrated_info) { + status = pp_smu->rn_funcs.get_dpm_clock_table(&pp_smu->rn_funcs.pp_smu, &clock_table); + + if (status == PP_SMU_RESULT_OK && + ctx->dc_bios && ctx->dc_bios->integrated_info) { rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info); } } -- 2.25.1