Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp47235pxk; Tue, 15 Sep 2020 17:22:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDDqMGHB0WTRns9qUjDBmJc3f9OU8YFGuEqTIZHZ6naXyV+h+QV1GxYObDVnxnyDr5JkwY X-Received: by 2002:a17:906:cc98:: with SMTP id oq24mr22192525ejb.106.1600215766103; Tue, 15 Sep 2020 17:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600215766; cv=none; d=google.com; s=arc-20160816; b=tgWwBLT9fXMGREFxcBd8WkffoITQFaTY9Gg+g/KtIzYuRFvqWOlX0k9mpJI5cWWM9U N1f5lgVg54s9om5BQPXAAx8NNiWZAT6XNzGaxfWVnysMVdEUByHgY1EI1J5bVokJEJv1 GxcQsokLZzcAMC3Mp2K+e2B1Pf8BDaQ6PRVO+56XJ81DQw1uY3RiBozaDFu90RBbzYzg k+VLkXfwJLCukfleJG/lKFCC84YjSdufbmBjg3MJ+OUoxmK67qyOnHZNEqzRixCSPvYZ PdXWaPEsvU1WyTxyn/D/MIgQ+VrUaoO9tB8hxkHzdv40CyxUeb0DcmfBWeRfBRteifBg lTMg== 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=T+pYBCKtH8svc9ixrymhVit4vZ6xJ99XYCLe2+fv8VM=; b=XkQBIlLMFWBU4qFKh1TeBw6K55rDMAUIYfKqOh1DdYj0X/US/Dr3lhwNjMmEmq9YnB O8qZYFA9Puzg1hBTUWtDgXYzssHoX6Hsz+yNMIRXTnrKoCo4LB1P+aO5+uojGuvjeLJ/ vk4FBLvenDJNsv5kWWtlv4p1j7CxapHMWV86ARc30/unfghGOchvRlu/i90Lsi+WmPWM 6sD24I9W35l732OqO1bQUmj20xDb8thYIX+L6h17RHNrM4mbatIaPPb21bt7sbmMA6IM fC8qZ4WMF5FM9WVAhrlZIkySvjmSOPT4fvGKjnn7OMO/uA/es5lKzckMW+sWCPE0aAA7 8F7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uOSXVAXh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf25si10820780ejb.67.2020.09.15.17.22.23; Tue, 15 Sep 2020 17:22:46 -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=uOSXVAXh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726976AbgIPATr (ORCPT + 99 others); Tue, 15 Sep 2020 20:19:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:38170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbgIOOWR (ORCPT ); Tue, 15 Sep 2020 10:22:17 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 885FE22272; Tue, 15 Sep 2020 14:17:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179456; bh=Hw1X4RE33CTzK4sAiopuEovNVhAN4Phqjl630csa/VU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uOSXVAXhAX5LaGy4jaSrXVypvXpoyaChxKkNy/0IB6UREcpIEByprdIBk/oFdFVl+ LghERBl7lQdV+sFODIoHJA1HpucjE/BFzMmiLrI5O0vjWQuZlmirwCjdOB9vKFAbqR 36aS24UyXLo4CkBTulEmzqocHan+8jpmueV3HAxk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sandeep Raghuraman , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 37/78] drm/amdgpu: Fix bug in reporting voltage for CIK Date: Tue, 15 Sep 2020 16:13:02 +0200 Message-Id: <20200915140635.439028153@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140633.552502750@linuxfoundation.org> References: <20200915140633.552502750@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: Sandeep Raghuraman [ Upstream commit d98299885c9ea140c1108545186593deba36c4ac ] On my R9 390, the voltage was reported as a constant 1000 mV. This was due to a bug in smu7_hwmgr.c, in the smu7_read_sensor() function, where some magic constants were used in a condition, to determine whether the voltage should be read from PLANE2_VID or PLANE1_VID. The VDDC mask was incorrectly used, instead of the VDDGFX mask. This patch changes the code to use the correct defined constants (and apply the correct bitshift), thus resulting in correct voltage reporting. Signed-off-by: Sandeep Raghuraman Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index 219440bebd052..72c0a2ae2dd4f 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c @@ -3566,7 +3566,8 @@ static int smu7_read_sensor(struct pp_hwmgr *hwmgr, int idx, case AMDGPU_PP_SENSOR_GPU_POWER: return smu7_get_gpu_power(hwmgr, (uint32_t *)value); case AMDGPU_PP_SENSOR_VDDGFX: - if ((data->vr_config & 0xff) == 0x2) + if ((data->vr_config & VRCONF_VDDGFX_MASK) == + (VR_SVI2_PLANE_2 << VRCONF_VDDGFX_SHIFT)) val_vid = PHM_READ_INDIRECT_FIELD(hwmgr->device, CGS_IND_REG__SMC, PWR_SVI2_STATUS, PLANE2_VID); else -- 2.25.1