From patchwork Wed Feb 7 17:40:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10205769 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 9CC9160247 for ; Wed, 7 Feb 2018 17:40:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D4D52902E for ; Wed, 7 Feb 2018 17:40:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80E992905C; Wed, 7 Feb 2018 17:40:35 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 212F82905F for ; Wed, 7 Feb 2018 17:40:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 40A146E15E; Wed, 7 Feb 2018 17:40:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qk0-x242.google.com (mail-qk0-x242.google.com [IPv6:2607:f8b0:400d:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id A62DA6E15E; Wed, 7 Feb 2018 17:40:31 +0000 (UTC) Received: by mail-qk0-x242.google.com with SMTP id m130so2156824qke.1; Wed, 07 Feb 2018 09:40:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JFfoGS9y65/+5Jil8E2YtJlM1hoZwcKCVRGwMKK29cs=; b=OAQt0nXJMg9cdBgnnvg1Ca1Wc3UHz/aKW/XMjRmorbu4tuzNb0OssXud5xyUWpp/Iz VFyUuUUmytVfUx/mN9FzjIpcie9B0W+bqG8j5E7kqQTyRCfEoaVkVfgAkQmgSUR0bHEw lNoSGY8axR5d/ghY8PKxpTrycQPQpCwOBMy6VUyf+kU/lyZolzSNM3ybHfX9q0Ehe4To kxP0dAlNlm4c7E2lG04NO1NPifBqOaS9M0Iub3hcxB5Vt5nAqQHxVTG0ztzJtN89EDPi Ed6TxaD/lfhXgjjwc6kcwhcC4kw2DeJG4NhM15O/QL/8674ATsWUc2njUPxJ1jt4XcHB GhGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JFfoGS9y65/+5Jil8E2YtJlM1hoZwcKCVRGwMKK29cs=; b=E+yLlzqy2rAY38c3KOntY9SCqU6jF4KnelgLbn8Q9PIQRmk2ewJdTAfGvHVhz2fg4d gPyP12qG4DgtVV/9c4+G9iTMDY07oWdwqqu2sYJ1jHRS/E1O/6tnfJ6wD4zlDL2buGHj nShUK5Sy9CFkFwGYcyK16V/XtEoP8sZE2rMvA3Aw8xTJn7wEs8kkay+HrgRZLpH0QtLy C1UmkS4u2cAxVzPDf+O6qewbmI/p2qdPnM4/oJvVbJ9GPDPaJ+ZfVS0yRR5HyLlnWCZq xZAHCZs1R7ALY4se+swL0RackQH93vQuqPoQbhZRhUGXQMnS+0guGj/a0i6vZEzYEgCP cvmA== X-Gm-Message-State: APf1xPDZy31GJdUV+MWEe+x/Ur5GCoUpWH43XpuPauiXmdp91LfNkxLZ HDPRvXIrATmGFyKTApo0xY0= X-Google-Smtp-Source: AH8x225FWC4HXJOPJHqQrNIYqVAEMumRAgVT6ZZyS9ejaNfsq0DGrAcaeUL3kOXstMc6bij1qevilg== X-Received: by 10.55.19.19 with SMTP id d19mr10297817qkh.356.1518025230680; Wed, 07 Feb 2018 09:40:30 -0800 (PST) Received: from localhost (p200300E41F41B00009B231EAB1BE76D4.dip0.t-ipconnect.de. [2003:e4:1f41:b000:9b2:31ea:b1be:76d4]) by smtp.gmail.com with ESMTPSA id v14sm1447609qtc.56.2018.02.07.09.40.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 09:40:30 -0800 (PST) From: Thierry Reding To: Ben Skeggs Subject: [PATCH] drm/nouveau: Make clock gate support conditional Date: Wed, 7 Feb 2018 18:40:27 +0100 Message-Id: <20180207174027.24468-1-thierry.reding@gmail.com> X-Mailer: git-send-email 2.15.1 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: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The recently introduced clock gate support breaks on Tegra chips because no thermal support is enabled for those devices. Conditionalize the code on the existence of thermal support to fix this. Fixes: b138eca661cc ("drm/nouveau: Add support for basic clockgating on Kepler1") Cc: Martin Peres Cc: Lyude Paul Signed-off-by: Thierry Reding Reviewed-by: Lyude Paul --- drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c index bf62303571b3..3695cde669f8 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/therm/base.c @@ -301,7 +301,7 @@ nvkm_therm_attr_set(struct nvkm_therm *therm, void nvkm_therm_clkgate_enable(struct nvkm_therm *therm) { - if (!therm->func->clkgate_enable || !therm->clkgating_enabled) + if (!therm || !therm->func->clkgate_enable || !therm->clkgating_enabled) return; nvkm_debug(&therm->subdev, @@ -312,7 +312,7 @@ nvkm_therm_clkgate_enable(struct nvkm_therm *therm) void nvkm_therm_clkgate_fini(struct nvkm_therm *therm, bool suspend) { - if (!therm->func->clkgate_fini || !therm->clkgating_enabled) + if (!therm || !therm->func->clkgate_fini || !therm->clkgating_enabled) return; nvkm_debug(&therm->subdev, @@ -395,7 +395,7 @@ void nvkm_therm_clkgate_init(struct nvkm_therm *therm, const struct nvkm_therm_clkgate_pack *p) { - if (!therm->func->clkgate_init || !therm->clkgating_enabled) + if (!therm || !therm->func->clkgate_init || !therm->clkgating_enabled) return; therm->func->clkgate_init(therm, p);