Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1619980ybv; Fri, 21 Feb 2020 00:25:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxJghOa+ApU07/5MRYwKalvLpslvOvG67WyrdcTM8um6J5sceztyBdNen/g/3nlsOvy+bSu X-Received: by 2002:aca:52d0:: with SMTP id g199mr951960oib.153.1582273527165; Fri, 21 Feb 2020 00:25:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582273527; cv=none; d=google.com; s=arc-20160816; b=yX7T++ajuqgy33fdHP+0p1S9TaEPA0DzqJhiL+Jl7HEzUuXZQn782sDHJI5lV++YOb i11g6++LevljZCXSsjTvQxO2qbjLO5FGesjlC13Vb2M+05/DtlPlQDurqKDCMxgaC9Bk u81d83AJiaGjNGAdW7B6iDtUlEUS4SLXljUVHz+lrA2StATMmsRsmOUxJKhLM4aEJYFT npXyQ998714S3CvrBHBNvME5XvUb4ZOBT4or+/BZIRTuM9Ujx977AypjCnolKGYyOIwN wz6qvTceMR6049HAIJjMMsuWswLy8h6UzIGwegHH9U/guwbNWlAyrgvHM7fjkiT2nzvH KSBA== 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=QLKY8DYC7FnQQ+3NSZGbdwZHSRL7JMlPJNOFSYB0lRQ=; b=N1yhu6DMl93rTy+0OodkND2G8qgorwh4Ie3/fMqXwLDjUg+5FoN9kholLbDp753JGG spchaaHZYivi3juilF7gWrk4wkO7hRtKywRi5uGQZOyBqPUWOV5MnbWVBkRnMiCkFVnH iTsT5kPyrRTQC7cGqvjY9C3ZOvGtyluxyUw7h8wJl8PRZA3n8pxanMXNUzD79K98x5Ve WsMzY0pYb08fIRqMDVySFV8rl1Sr22qAXzmDIZdLqmi3S0YufXfeZOeIMQMs5oWqNg/l SkVnSfjjoHD3vsn8qN18doedXnBBmtrShv0+9qkFx5x/ZfPbEMr3VtJvrfVIUT/QD93B yvxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XEHMZkXq; 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 a22si441672oii.98.2020.02.21.00.25.15; Fri, 21 Feb 2020 00:25:27 -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=XEHMZkXq; 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 S2388678AbgBUIYg (ORCPT + 99 others); Fri, 21 Feb 2020 03:24:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:37036 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388667AbgBUIYb (ORCPT ); Fri, 21 Feb 2020 03:24:31 -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 CA186246A1; Fri, 21 Feb 2020 08:24:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582273471; bh=kpxSpiOredmCdN9Q0Stfhh2Dls3j079H4/egN8JsXU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEHMZkXqWIH1Y4dMpFwx8yWHEPRfsE3/a8lrm0pePfSyIrXrpz1PAQjEuRfimOQ32 1ReK0tXmQ6hqm3CNc7KR8UcLlb/BT44NQprmnwBD07znrO3fBjRLXNcjC7z1KlzL3P IykrYTM6bAakIDAqiL0Tegc2JkubokSHjR0Ds0QQ= 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 184/191] drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_latency Date: Fri, 21 Feb 2020 08:42:37 +0100 Message-Id: <20200221072312.821201678@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 4d0a72b66065dd7e274bad6aa450196d42fd8f84 ] Only send non-0 clocks to DC for validation. This mirrors what the windows driver does. 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 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c index 1546bc49004f8..3fa6e8123b8eb 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c @@ -994,12 +994,15 @@ static int smu10_get_clock_by_type_with_latency(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].latency_in_us = latency_required ? - smu10_get_mem_latency(hwmgr, - pclk_vol_table->entries[i].clk) : - 0; - 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].latency_in_us = latency_required ? + smu10_get_mem_latency(hwmgr, + pclk_vol_table->entries[i].clk) : + 0; + clocks->num_levels++; + } } return 0; -- 2.20.1