From patchwork Tue Mar 14 00:26:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 9622357 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 E27B960414 for ; Tue, 14 Mar 2017 00:26:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4C8728480 for ; Tue, 14 Mar 2017 00:26:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C89A028514; Tue, 14 Mar 2017 00:26:11 +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 5444328480 for ; Tue, 14 Mar 2017 00:26:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0022089D66; Tue, 14 Mar 2017 00:26:09 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id D3A9089D66 for ; Tue, 14 Mar 2017 00:26:07 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2017 17:26:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,161,1486454400"; d="scan'208";a="75720008" Received: from relo-linux-11.sc.intel.com ([10.3.160.214]) by fmsmga005.fm.intel.com with ESMTP; 13 Mar 2017 17:26:07 -0700 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Mon, 13 Mar 2017 17:26:06 -0700 Message-Id: <20170314002606.8838-1-michel.thierry@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [Intel-gfx] [PATCH] drm/i915: get a runtime PM ref in i915_wedged_set X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP At least in bxt (with decoupled mmio), it prevents a warning while capturing the reg state: [ ] WARNING: assert_rpm_wakelock_held.part.4+0x1e/0x20 [i915] [ ] RPM wakelock ref not held during HW access [ ] Call Trace: [ ] dump_stack+0x63/0x87 [ ] __warn+0xd1/0xf0 [ ] ? fwtable_write32+0x1a0/0x1a0 [i915] [ ] warn_slowpath_fmt+0x4f/0x60 [ ] ? vprintk_default+0x29/0x50 [ ] assert_rpm_wakelock_held.part.4+0x1e/0x20 [i915] [ ] gen9_decoupled_read32+0x18a/0x1a0 [i915] [ ] ? fwtable_write32+0x1a0/0x1a0 [i915] [ ] i915_handle_error+0x1d0/0x260 [i915] [ ] ? __check_object_size+0x170/0x1aa [ ] i915_wedged_set+0x25/0x30 [i915] These get/put were removed by commit 9c870d03674f ("drm/i915: Use RPM as the barrier for controlling user mmap access"), before decoupled mmio was added in commit 85ee17ebeedd ("drm/i915/bxt: Broxton decoupled MMIO). Reported-by: Antonio Argenziano Signed-off-by: Michel Thierry Tested-By: Antonio Argenziano --- drivers/gpu/drm/i915/i915_debugfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 9fcc4f1a86fc..89f211391ef9 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -4155,9 +4155,13 @@ i915_wedged_set(void *data, u64 val) if (i915_reset_in_progress(&dev_priv->gpu_error)) return -EAGAIN; + intel_runtime_pm_get(dev_priv); + i915_handle_error(dev_priv, val, "Manually setting wedged to %llu", val); + intel_runtime_pm_put(dev_priv); + return 0; }