Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp737245imm; Thu, 13 Sep 2018 07:03:21 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaiXgpRMbwJvWE12zyQZgcYczgotMjm4Nl1n9rSHm4z/eBJSzQIQMGQKiItOd44HLQLPmM3 X-Received: by 2002:a63:4b47:: with SMTP id k7-v6mr7233122pgl.351.1536847401105; Thu, 13 Sep 2018 07:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847401; cv=none; d=google.com; s=arc-20160816; b=hAyqN+BKQWvC0a16+Zs+pXYvaWVsEhOUzx7YMQb9nodjkVyn9KfJQFjftfOQYMidey w+b0VyktwyckO1IM2lXF1iX1nvS2TvWabRS18IQYFgiZ9RdygiDtfhXOSmZW11F5qlG9 4j829mjFwCiC180SW3BkjWrPdypnRRzLs7CUY3P7zzcAyL8raEl0qnGCLRv3Xir3+nqm xzv+sYdmraKaEb6wyhQYYhct7IDOWHaY/O0JMwemJ6T+rvy1lJoicVzyDItzMhDLBx2X rCbnsVIjRSEp06qBpgmobbEnZOx5xFFjVzhF1OTtM+GqcS5S/rZDlEEz5UuIV7xcWrWJ B72Q== 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; bh=QBD4Q/eKjBWaqUxUaK34ZPHzoAZVkhLIPKAcsD/19Aw=; b=K0AA71RWwrGVqC9hRWIS7Udo9WAX/RpORZDjwFUB+OMTqiqRf7whh7fq7/QnQBBssy uiOkiDAGXEzA9Hib+f+j1OjyiDcNGEFIK4Ku8ovt7Ehv5Ubw7BhKWA0hcy/0/McDLYyy NJtZOxLRLHvpbbY+Udr4Cjn1tF6vp6X8lyFS2DlhJSGw56HQfat3yMM+fShRd0tsIQGA ySB8EzqDxQiWn+2DjWpX3vpjTWkq4eMyyKk6BW8L9FAc8pTGfk7SoTiWS33c7CVd2/RB j97V/oktf4hFP5CJdxFYM9NuHNKyY2fmlfn93Y7QINjB+PH9dJHmxwbSSLsikyZtSwYz +XlA== ARC-Authentication-Results: i=1; mx.google.com; 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 d9-v6si3672075pgo.470.2018.09.13.07.03.04; Thu, 13 Sep 2018 07:03:21 -0700 (PDT) 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; 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 S1732005AbeIMTMY (ORCPT + 99 others); Thu, 13 Sep 2018 15:12:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:35276 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731126AbeIMTMX (ORCPT ); Thu, 13 Sep 2018 15:12:23 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E2497D35; Thu, 13 Sep 2018 14:02:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Alex Deucher , Rex Zhu Subject: [PATCH 4.18 159/197] drm/amd/pp: Convert voltage unit in mV*4 to mV on CZ/ST Date: Thu, 13 Sep 2018 15:31:48 +0200 Message-Id: <20180913131847.915638091@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rex Zhu commit 8a50bb47a863c3cb8950a2e810448c9a82a9d446 upstream. the voltage showed in debugfs and hwmon should be in mV Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c @@ -244,6 +244,7 @@ static int smu8_initialize_dpm_defaults( return 0; } +/* convert form 8bit vid to real voltage in mV*4 */ static uint32_t smu8_convert_8Bit_index_to_voltage( struct pp_hwmgr *hwmgr, uint16_t voltage) { @@ -1702,13 +1703,13 @@ static int smu8_read_sensor(struct pp_hw case AMDGPU_PP_SENSOR_VDDNB: tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_NB_CURRENTVID) & CURRENT_NB_VID_MASK) >> CURRENT_NB_VID__SHIFT; - vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp); + vddnb = smu8_convert_8Bit_index_to_voltage(hwmgr, tmp) / 4; *((uint32_t *)value) = vddnb; return 0; case AMDGPU_PP_SENSOR_VDDGFX: tmp = (cgs_read_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixSMUSVI_GFX_CURRENTVID) & CURRENT_GFX_VID_MASK) >> CURRENT_GFX_VID__SHIFT; - vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp); + vddgfx = smu8_convert_8Bit_index_to_voltage(hwmgr, (u16)tmp) / 4; *((uint32_t *)value) = vddgfx; return 0; case AMDGPU_PP_SENSOR_UVD_VCLK: