Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1620920ybv; Fri, 21 Feb 2020 00:26:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwcV/b7FJtrD/b8wC1yOEYSIbqdB49Lyvpf3T0jcvajepCkuvAkTNivFNunTQLHGQF0Qy7Q X-Received: by 2002:a54:4086:: with SMTP id i6mr1032087oii.65.1582273593847; Fri, 21 Feb 2020 00:26:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273593; cv=none; d=google.com; s=arc-20160816; b=jFBtNfmzXs9rdDCLE3+Z6otLrFxEYUquHrD0wLe42elJ/d+kiXT3PkI/dyiVRf6cR0 9Rz5eZsM0+j2AZFbJoOQxinbl5wrEdAe0HJiCnubGa/8eENPJbT+rROZyRusQpWsi7mz bdx30y5F3dhW5nKhRtbt408nd63moxqaktIjpUxAUEyf8XAc8LN6PKFKeFldjBo84Fx9 eogBZYX+DEJZy4zdxAZ2hEeu1VYTqzz+xGqBjbSNsMMCHLuRfgdsMSpzoHubuSeW/IUF iZCxCvwOtKta4AQyeorqb3iQ+ZOkdlw7Fu9EvnONJAMd3wlG2Tz6b3nWO37x0jStDukI Uhow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V3xbR1+mIyszX3mr46GAJul4nKpvIDx3Yft99TD9stg=; b=Vd9lbnSMr1iz815Vl91Awl2AOqyfnWuaXLPJqUaiY7eevq0iHQeWPQTENc98ZfBu68 +7hm2HKsJkfN8ZmGhXoU3nVnDZj7JHUg6H/tLoW9nD8Dphsd9IPyCT6p0IlRhh6gUc58 Uj9q9rx+pZrzCQT3LXLnXWZlswVkJxgV/SkM6zANVQE9jVI4Lxcqc6EgYSZsbAVpJRM+ nawtGEESXyHr8NhQCXkGFGJPliH+H4OnvnqsiniCfr829e2Wm5Z0XX2xtABhArpJLVT3 fY1tGtAUFBpcsaTVrS6LFfanrMRj4ex4TnD96P4zo9Z4golDso87ClA4+CPKYvQXAZee FIYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZFl6EAom; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si531810oiy.124.2020.02.21.00.26.22; Fri, 21 Feb 2020 00:26:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZFl6EAom; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388689AbgBUIYq (ORCPT + 99 others); Fri, 21 Feb 2020 03:24:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:37152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388391AbgBUIYg (ORCPT ); Fri, 21 Feb 2020 03:24:36 -0500 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 EA1B3246A9; Fri, 21 Feb 2020 08:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273476; bh=6uuL2kpSArz8OwtyYslYE7k2qCheH7HvEGUTMDexYsI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZFl6EAomVZOM9MnLrcwbaetsiHfNE1VL95YjzNN5h2ZCIb967318g8t3muCe753H9 lW0mdUaTaIdwdlEKQIsUud42Jpp+J6l4An19XuFRc2kn3NWb+hYkkvzLZRhowHZZyQ rStLjQWSQoz0t7iW+O5Pnuowxzm1M+lUG3OnTcRk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 185/191] drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_voltage Date: Fri, 21 Feb 2020 08:42:38 +0100 Message-Id: <20200221072312.966159239@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072250.732482588@linuxfoundation.org> References: <20200221072250.732482588@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher [ Upstream commit 1064ad4aeef94f51ca230ac639a9e996fb7867a0 ] Cull out 0 clocks to avoid a warning in DC. Bug: https://gitlab.freedesktop.org/drm/amd/issues/963 Reviewed-by: Evan Quan Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c index 3fa6e8123b8eb..48e31711bc68f 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c @@ -1048,9 +1048,11 @@ static int smu10_get_clock_by_type_with_voltage(struct pp_hwmgr *hwmgr, clocks->num_levels = 0; for (i = 0; i < pclk_vol_table->count; i++) { - clocks->data[i].clocks_in_khz = pclk_vol_table->entries[i].clk * 10; - clocks->data[i].voltage_in_mv = pclk_vol_table->entries[i].vol; - clocks->num_levels++; + if (pclk_vol_table->entries[i].clk) { + clocks->data[clocks->num_levels].clocks_in_khz = pclk_vol_table->entries[i].clk * 10; + clocks->data[clocks->num_levels].voltage_in_mv = pclk_vol_table->entries[i].vol; + clocks->num_levels++; + } } return 0; -- 2.20.1