From patchwork Wed Jan 7 16:09:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Daniel X-Patchwork-Id: 5585571 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 48CE4BF6C3 for ; Wed, 7 Jan 2015 16:10:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7A86B201F4 for ; Wed, 7 Jan 2015 16:10:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 73D1A201EC for ; Wed, 7 Jan 2015 16:10:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 959566E37F; Wed, 7 Jan 2015 08:10:02 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 249986E37F for ; Wed, 7 Jan 2015 08:10:01 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 07 Jan 2015 08:10:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,715,1413270000"; d="scan'208";a="647639128" Received: from thomasda-linux2.isw.intel.com ([10.102.226.158]) by fmsmga001.fm.intel.com with ESMTP; 07 Jan 2015 08:09:59 -0800 From: Thomas Daniel To: intel-gfx@lists.freedesktop.org Date: Wed, 7 Jan 2015 16:09:30 +0000 Message-Id: <1420646970-4897-1-git-send-email-thomas.daniel@intel.com> X-Mailer: git-send-email 1.7.9.5 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: Reset CSB read pointer when enabling contexts 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 During a suspend/resume cycle the hardware Context Status Buffer write pointer is reset. However since recent changes to the init sequence the software CSB read pointer is no longer reset. This means that context status events are not handled correctly and new contexts are not written to the ELSP, resulting in an apparent GPU hang. Pending further changes to the ring init code, just move the ring->next_context_status_buffer initialization into i915_gem_context_enable to fix this regression. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88097 Cc: Paulo Zanoni Signed-off-by: Thomas Daniel Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/i915_gem_context.c | 1 + drivers/gpu/drm/i915/intel_lrc.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index bf9778e..cc100c9 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -412,6 +412,7 @@ int i915_gem_context_enable(struct drm_i915_private *dev_priv) if (i915.enable_execlists) { for_each_ring(ring, dev_priv, i) { + ring->next_context_status_buffer = 0; if (ring->init_context) { ret = ring->init_context(ring, ring->default_context); diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 7670a0f..4580267 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1394,7 +1394,6 @@ static int logical_ring_init(struct drm_device *dev, struct intel_engine_cs *rin INIT_LIST_HEAD(&ring->execlist_queue); INIT_LIST_HEAD(&ring->execlist_retired_req_list); spin_lock_init(&ring->execlist_lock); - ring->next_context_status_buffer = 0; ret = i915_cmd_parser_init_ring(ring); if (ret)