Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6023770ybc; Wed, 27 Nov 2019 13:35:15 -0800 (PST) X-Google-Smtp-Source: APXvYqwq5H3Ic5GHoKnSUJ0QQ+xblQKwovUvbhR2LsOU6pRsYI5VZc7U7+GDUDvcJPN2P++7TIBz X-Received: by 2002:a17:906:3786:: with SMTP id n6mr35856451ejc.124.1574890514990; Wed, 27 Nov 2019 13:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574890514; cv=none; d=google.com; s=arc-20160816; b=COUeRAQZJGKyP35pJqcXNYGyOzzY/dljFo8u7O2WMksvMBvUiH62w/ZCKePSvdOlgW u77SzAhMv0tAfI/Y4TcRPc1dQC0ps3T/turlJb6pSf4pGbpILlVkCqLpXf4gDTmMXO6G EcGoCj5L2tOM0LEiewfd5ntn0xtvWO5KH7EKoMs2SBi5qzEQ22GL5jpFch51ov1P0hiE VNAbGoKwkuxTfEcYOTtAzzkLmX4+n/Kv4OzzhyQznkpF/sE/YVVrXIgSgTdTbcz63ZAS ZgdAG87utSpe4lNe9IY+WpcgjYAWAV2MlFLpAjw6N8VhrLMoclxV2hxt7fP0bLTwOlNm sGKA== 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=7GoZq99Y5ZMaZa+hFrgyHbpJLZPhNVhoPhf0Hb7kEo4=; b=JJ8sX1wOlLLEK8ylO1Q7Ay3hJj6RnHD3azgEOy/y6d2p9JDJzzuD7yJdZ02WOyZRN0 UTRbhUlqHGII9ePOQv30gKdVNXN+hsilfRTvkRN7fBL9IMjNJotbIfYb2FMrKJ94xsSI CLgvi0Cl70+/knET8QTHOsTLEzhJ9ubZCMVH7S5hMRmfnw7bW9Y2LJLrJcsWi0Mu/yJd 6r35hG5Kc1bpA8oOiwaYrq/nERi+2OXhOR8mlGElm2oBquCx//9+jxASz+uNH2ewPtsN m47gInYHsRHojpRJPBlWik1AUEg5Wld718NrEnDOYeStVDMWGsJq9d62SGhwNLX5sACD uDFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=skyNc9WX; 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 v8si1773191ejw.357.2019.11.27.13.34.51; Wed, 27 Nov 2019 13:35:14 -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=skyNc9WX; 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 S1730968AbfK0Uzh (ORCPT + 99 others); Wed, 27 Nov 2019 15:55:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:46086 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730654AbfK0Uzf (ORCPT ); Wed, 27 Nov 2019 15:55:35 -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 C68A720862; Wed, 27 Nov 2019 20:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888134; bh=ocDDI6UNN/IZnta24ouw3SRUvHXXUlZZoHZJyZBfJQg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=skyNc9WX+1tmjgIwkw+er6UvUTKp2g54ypsDA7hU0iZR2ToVYNOpIoFHNDpljOHnv 9mGQNHhN8qqJw39ls/PPxSANRe3fM1wDO6zGZVXA5W0ZyPe/RlKBmi3G12SYdqBU+z +oWfGkXprFCI74qlc67FESCfHKMUIwF+R+SniOy8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Alex Deucher Subject: [PATCH 4.19 018/306] drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs Date: Wed, 27 Nov 2019 21:27:48 +0100 Message-Id: <20191127203116.029122590@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@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: Evan Quan commit 355d991cb6ff6ae76b5e28b8edae144124c730e4 upstream. Otherwise, the error message prompted will confuse user. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c @@ -3472,18 +3472,31 @@ static int smu7_get_pp_table_entry(struc static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query) { + struct amdgpu_device *adev = hwmgr->adev; int i; u32 tmp = 0; if (!query) return -EINVAL; - smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0); - tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0); - *query = tmp; + /* + * PPSMC_MSG_GetCurrPkgPwr is not supported on: + * - Hawaii + * - Bonaire + * - Fiji + * - Tonga + */ + if ((adev->asic_type != CHIP_HAWAII) && + (adev->asic_type != CHIP_BONAIRE) && + (adev->asic_type != CHIP_FIJI) && + (adev->asic_type != CHIP_TONGA)) { + smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0); + tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0); + *query = tmp; - if (tmp != 0) - return 0; + if (tmp != 0) + return 0; + } smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart); cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,