Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4156805pxk; Tue, 8 Sep 2020 12:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMeK+p/jpFtLusx0gIMYKjVpQuRQITtf8jmhcRvxH07P4iRDP1yfZW2gg/W3trpz4YMHEh X-Received: by 2002:aa7:d747:: with SMTP id a7mr468065eds.304.1599592062037; Tue, 08 Sep 2020 12:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599592062; cv=none; d=google.com; s=arc-20160816; b=JOpYOyFezEceERHhmBykc+4n/1YL384txoiS9C5FgAYasT/QP6tVasNnVpt/43S4l/ 3dM+FYDpHh5sRuDdiW054xFvvKO4gKHZ85IsChYy+g/CwXGVUGwvEM2I2esgtg6NvXY9 O6cjOFt2xP8Ga1HPHVzeuI6yO//qC1mhBlHN+1usDW1r/41AGTuFiDmfy3EUWweoepUo P4WabzQi4ccvpkdN6jGZsDBjYYcpFjt1UwXGUsJmXLmjaoOsEjbC8SGvIFfz46NVaZHX 6NH6SsRlbd+JGmnzZRo3Lksf8WQiUALsTP6pqA3TflQEkguNzlmS5qxvooyFSaF68YPc kd5g== 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=QMVzYY41oCxdRPa1AEzPiytbRdtdCQiXtWtOscfRm0s=; b=ARe6Xbr15kengq5Ca8HlpFvc6ivi1/i8VuFotloyzSHrhm7jHpnbjNwSlvvAABccDM sxBQrZFOLCPTHH30lLGpZ/BwSfGMAiL8XTyg5GQMKxuuqcK/y5CWoy2oeJJvdFItbxR0 2To/7EP1nTc7+yK/ZGhNk9O987xBjL9G2oMoHUZ23LBfsPHIaFfAIrTwthP9Vd7Se0Bk wDsM5fRFTaNdOt3QnvzjLGv2EkLfbq+pltM/VVurtvWdXdrhE2tjaXnPSZXizXC1TrSJ uryp5ywCuzi5uhRAI9Lkncqs+Ohub9xSIERFfR4yLAjqn1k0L+d5ZgI1mCdFR3qILKre gUqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MyI+eJaq; 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 o14si12117993ejc.648.2020.09.08.12.07.18; Tue, 08 Sep 2020 12:07:42 -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=MyI+eJaq; 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 S1731599AbgIHTE4 (ORCPT + 99 others); Tue, 8 Sep 2020 15:04:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731268AbgIHQH0 (ORCPT ); Tue, 8 Sep 2020 12:07:26 -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 3189F23E53; Tue, 8 Sep 2020 15:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599580033; bh=yvT6yK6uDpm1fil5NPH3jIOhIuMTvfb3Xnuf17cwW3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MyI+eJaqiF/skAsYjtEh7fyV7WVgJMpSFdM36jkpOXJqm2afqkGzxTiuBx/5qxufe KwUE9nUqflmUNCOn9AhA557lgfNcetiWd/F6SMRlXO8lUG22SYwBgzAVwdeCXPD3QQ S4mYcEijwiv/NtkdKpC+n7EeT058ObD12EDNVV3A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Alex Deucher Subject: [PATCH 5.4 112/129] drm/amd/pm: avoid false alarm due to confusing softwareshutdowntemp setting Date: Tue, 8 Sep 2020 17:25:53 +0200 Message-Id: <20200908152235.436199841@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908152229.689878733@linuxfoundation.org> References: <20200908152229.689878733@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 971df65cbf32da9bc9af52c1196ca504dd316086 upstream. Normally softwareshutdowntemp should be greater than Thotspotlimit. However, on some VEGA10 ASIC, the softwareshutdowntemp is 91C while Thotspotlimit is 105C. This seems not right and may trigger some false alarms. 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/vega10_thermal.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c @@ -375,8 +375,18 @@ static int vega10_thermal_set_temperatur /* compare them in unit celsius degree */ if (low < range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES) low = range->min / PP_TEMPERATURE_UNITS_PER_CENTIGRADES; - if (high > tdp_table->usSoftwareShutdownTemp) - high = tdp_table->usSoftwareShutdownTemp; + + /* + * As a common sense, usSoftwareShutdownTemp should be bigger + * than ThotspotLimit. For any invalid usSoftwareShutdownTemp, + * we will just use the max possible setting VEGA10_THERMAL_MAXIMUM_ALERT_TEMP + * to avoid false alarms. + */ + if ((tdp_table->usSoftwareShutdownTemp > + range->hotspot_crit_max / PP_TEMPERATURE_UNITS_PER_CENTIGRADES)) { + if (high > tdp_table->usSoftwareShutdownTemp) + high = tdp_table->usSoftwareShutdownTemp; + } if (low > high) return -EINVAL;