From patchwork Mon Mar 14 14:24:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 8579621 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8F89A9F6E1 for ; Mon, 14 Mar 2016 14:29:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93D6C203A5 for ; Mon, 14 Mar 2016 14:29:44 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id AB19C20377 for ; Mon, 14 Mar 2016 14:29:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61AC16E10D; Mon, 14 Mar 2016 14:29:41 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 168186E10D for ; Mon, 14 Mar 2016 14:29:38 +0000 (UTC) Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue002) with ESMTPA (Nemesis) id 0LovMS-1a9SVs3WTc-00eppE; Mon, 14 Mar 2016 15:24:20 +0100 From: Arnd Bergmann To: David Airlie Subject: [PATCH] nouveau: fix nv40_perfctr_next() cleanup regression Date: Mon, 14 Mar 2016 15:24:10 +0100 Message-Id: <1457965458-3319933-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:deqdniHHdtRJsXSNcgoEzI+DFMyFwJ9NyLchrL0THigLEmi6KZz lJK7YrdMwmJli5/TaL33zOaSuzLRkomh1Yrv+dC9L5IY3PkepK69AcO/7cQhXgISmngOcCh h1GIMhHlldt6hab9LnjIT4vJVmAkN+nn5YmjGII7QFTs2ZYV4vcHEl6oMQmuGz9R3Y6unAr WkFcrquID+Bva4KluKVTw== X-UI-Out-Filterresults: notjunk:1; V01:K0:UXyZLyyO9Fc=:3N2mWCwWYVyGzRfd3whAXy BLWYMATib4JF/KE9NhO5Y6CCMq9GgQW/k8Mjsn2vQiClxOIuaq89sI/PFx6CXS4nMlqG+HERi wxfAuuLiy4J4SC/VGicGy07aOz8xy4WA1AB+Er2JeqtjAaGvZ3HCcN9Rim/nTOoMkXXq65W6P fPEdlCfKqPQ636LzA+yOBcV9A5Dqp8IV9nFkoBoW7FW5N1gwbhC7PyHOEaMva+kUCuhiNtaiR 9kFIsXaVVE4fDOcGqXIOC4sQGvVq5oMJfz3lVNRkFfYldXP7JkjfcUW+q9bKmQBSRXlaauMcg fApz0a7iofA/QJbe++sAD/SeZuYVsi0DAsB8KG6GtKi0Vt5DOPVKj32Zwvu8r9FMl4cKGC9Sp 3uy2v8B6G7F6gqeo3z5hg3TqZiRiEanGpdSxDXjfihIVNH3TM9y2PErjo/cYkhOg5p0gK9zjV M2HadMjSkHo5FnO33yQblbMj37IssavKJLl6u41BCJL8itBNPHj+3zO3q7VH2AoNYMykjlaoQ 0sjuImziU9jlhUgm2JXD3AGrH/bvOetgXFpgiAwJsx/X6ucGdbEoI5FeOaxL9K3tZxN+xHjrI NBLyWypuorFeWWWlIrSBNc+mrUW9RHThdbm7Or+tAbFUaalBqpLZ/VSyrlOrS1RGyn/S0IT54 5eWCKfG+uDJocpkNNyWEluceEkrFxOctYycDg1R7gbHikyrkk2zkSiK+T/EZRMlz/p9w= Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Ben Skeggs , Arnd Bergmann X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP gcc-6 warns about code in the nouveau driver that is obviously silly: drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c: In function 'nv40_perfctr_next': drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c:62:19: warning: self-comparison always evaluats to false [-Wtautological-compare] if (pm->sequence != pm->sequence) { The behavior was accidentally introduced in a patch described as "This is purely preparation for upcoming commits, there should be no code changes here.". As far as I can tell, that was true for the rest of that patch except for this one function, which has been changed to a NOP. This patch restores the original behavior. Signed-off-by: Arnd Bergmann Fixes: 8c1aeaa13954 ("drm/nouveau/pm: cosmetic changes") Reviewed-by: Ben Skeggs Reviewed-by: Samuel Pitoiset --- drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c index 4bef72a9d106..3fda594700e0 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/pm/nv40.c @@ -59,9 +59,11 @@ static void nv40_perfctr_next(struct nvkm_pm *pm, struct nvkm_perfdom *dom) { struct nvkm_device *device = pm->engine.subdev.device; - if (pm->sequence != pm->sequence) { + struct nv40_pm *nv40pm = container_of(pm, struct nv40_pm, base); + + if (nv40pm->sequence != pm->sequence) { nvkm_wr32(device, 0x400084, 0x00000020); - pm->sequence = pm->sequence; + nv40pm->sequence = pm->sequence; } }