Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp921418imj; Sat, 9 Feb 2019 10:50:32 -0800 (PST) X-Google-Smtp-Source: AHgI3IbS2XfsBU2OmIoAXqV9W8YX6UgCKNaNta12fYJcXNLCES4NZLx2q8rZxhHeI/hpnWBtlroc X-Received: by 2002:a63:2bc4:: with SMTP id r187mr26373193pgr.306.1549738231959; Sat, 09 Feb 2019 10:50:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738231; cv=none; d=google.com; s=arc-20160816; b=KxczRR+R9CqMn/toIx6J153g71y22BqMQwk22BjBbguBM9SvuQnCaD0eQPEC3yY6XR XxctXRmTg+BPRTPsTST2x/bnpOWGzOKE+g1PUukdssIZ5SKOddu4g52cFUeRbA8iN5Du BcnLhRvyV4VQf8IG17tIUMf38I77ccuLGKS7U9M+AHHojfILlejZ65tDpCtCgnQ1RBn+ akaL+HvOaJgm0rRTeNBdJG7HcT5Z0FA5XRWQYgxkXkEfrO5v+07lEcpLgqrf4TGpNxU6 XEi8pIZhLqewsa63/sr70nCD/fM2LRgdHG5hQgltiJTOhXWCehE6mFZE5t/3h+sKocgE aWRA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c0x/WRy2sxxRMEELlhlJ/cx7WIXBYLKys8pWCwW6FkA=; b=So/Yli64hGrsy7TBy7MCyKRqUa+3/fkPoi2+E6PvA1fu55BqR66HhtBiL0Eyg1/L4s 66e3dTmKBwC4ophGcEEwfXHEOziw+KzbL+2YTKVLhZENgIuHbTybF6qpjxMaVsgIVgV0 babh8sllEAQRKYqmZ1XJoBR8HXynBMHwkI/PncWW/Gc0mRXnOcI9OIzDfCytBmsZCZfd S509EBfNd92NXd1qBV+h5pntWDPbIjD8teAEQ24t3PbTVfwW6R8CG6kQ+QRSdavq00ST p5nSPW+glGShKW5fsHulfkf0uc1UmiapnMN1RNFaeejnIECTHOp87bFowDd+LJz3cOAN RDQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AUKESnOr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si5650581pls.125.2019.02.09.10.50.16; Sat, 09 Feb 2019 10:50:31 -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=AUKESnOr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727734AbfBISsd (ORCPT + 99 others); Sat, 9 Feb 2019 13:48:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:33434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727678AbfBISsa (ORCPT ); Sat, 9 Feb 2019 13:48:30 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 360AF21919; Sat, 9 Feb 2019 18:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738110; bh=iIXzYjkzx8FW4knIQH0cq7xv08zI5qckJhdYfOn+pBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AUKESnOryzv6U33nWxx90fKCnBIlJu1cyq7uP3x6F7atVy2iJsfkcM3QWmOM48y2c 0jhePhQWkCmWslC1+d0rEqYFchBHmVsTWWpwAgzVhYf2bixZs7A9AAtGRYeqp0t8A4 t/Fpov1vLNceMb6M3Xqbx7mFSCzTG2FhPcz1jZQE= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ilia Mirkin , Ben Skeggs , Sasha Levin , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.20 37/42] drm/nouveau/falcon: avoid touching registers if engine is off Date: Sat, 9 Feb 2019 13:47:29 -0500 Message-Id: <20190209184734.125935-37-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilia Mirkin [ Upstream commit a5176a4cb85bb6213daadf691097cf411da35df2 ] Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980 Signed-off-by: Ilia Mirkin Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/engine/falcon.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c index 816ccaedfc73..8675613e142b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/falcon.c @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -107,8 +108,10 @@ nvkm_falcon_fini(struct nvkm_engine *engine, bool suspend) } } - nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000); - nvkm_wr32(device, base + 0x014, 0xffffffff); + if (nvkm_mc_enabled(device, engine->subdev.index)) { + nvkm_mask(device, base + 0x048, 0x00000003, 0x00000000); + nvkm_wr32(device, base + 0x014, 0xffffffff); + } return 0; } -- 2.19.1