From patchwork Thu Jan 25 18:16:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Klausmann X-Patchwork-Id: 10185321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3052B60383 for ; Fri, 26 Jan 2018 08:40:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1FD7729100 for ; Fri, 26 Jan 2018 08:40:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 147C829103; Fri, 26 Jan 2018 08:40:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3E8AF29100 for ; Fri, 26 Jan 2018 08:40:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A7836E3CA; Fri, 26 Jan 2018 08:39:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 514 seconds by postgrey-1.36 at gabe; Thu, 25 Jan 2018 18:25:24 UTC Received: from mout1.fh-giessen.de (mout1.fh-giessen.de [212.201.18.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 179516E6B2 for ; Thu, 25 Jan 2018 18:25:24 +0000 (UTC) Received: from mx1.fh-giessen.de ([212.201.18.40]) by mout1.fh-giessen.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eem4u-0006RE-SW for dri-devel@lists.freedesktop.org; Thu, 25 Jan 2018 19:16:48 +0100 Received: from mailgate-3.its.fh-giessen.de ([212.201.18.34]) by mx1.fh-giessen.de with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eem4u-000u6n-Pi for dri-devel@lists.freedesktop.org; Thu, 25 Jan 2018 19:16:48 +0100 Received: from p549d3ff8.dip0.t-ipconnect.de ([84.157.63.248] helo=sieben.localdomain.fritz.box) by mailgate-3.its.fh-giessen.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eem4u-0009Vc-Hh; Thu, 25 Jan 2018 19:16:48 +0100 From: Tobias Klausmann To: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: [PATCH] drm/nouveau/therm/gp100: Do not report temperature when subdev is shadowed Date: Thu, 25 Jan 2018 19:16:26 +0100 Message-Id: <20180125181626.3584-1-tobias.johannes.klausmann@mni.thm.de> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 26 Jan 2018 08:39:39 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tobias Klausmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This fixes wrong temperature outputs e.g. 511°C if the card is asleep. Signed-off-by: Tobias Klausmann Reviewed-by: Rhys Kidd --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c index 9f0dea3f61dc..45d0ec632b5a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/gp100.c @@ -32,8 +32,10 @@ gp100_temp_get(struct nvkm_therm *therm) u32 inttemp = (tsensor & 0x0001fff8); /* device SHADOWed */ - if (tsensor & 0x40000000) + if (tsensor & 0x40000000) { nvkm_trace(subdev, "reading temperature from SHADOWed sensor\n"); + return -ENODEV; + } /* device valid */ if (tsensor & 0x20000000)