From patchwork Wed Mar 5 16:08:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 3777241 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 38C479F383 for ; Wed, 5 Mar 2014 16:08:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E07920220 for ; Wed, 5 Mar 2014 16:08:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9206220211 for ; Wed, 5 Mar 2014 16:08:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E2A4FA7B5; Wed, 5 Mar 2014 08:08:26 -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 2B34BFA7B5 for ; Wed, 5 Mar 2014 08:08:24 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 05 Mar 2014 08:08:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,593,1389772800"; d="scan'208";a="486526349" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.72]) by fmsmga001.fm.intel.com with ESMTP; 05 Mar 2014 08:08:22 -0800 Received: by rosetta (Postfix, from userid 1000) id 4DE7F81666; Wed, 5 Mar 2014 18:08:22 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 5 Mar 2014 18:08:19 +0200 Message-Id: <1394035700-19630-2-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394035700-19630-1-git-send-email-mika.kuoppala@intel.com> References: <1394035700-19630-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Always set fifo count to zero in gen6_reset X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org 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 There should not be a case where fifo count is other than zero after a successful reset. Always set count to zero, but be paranoid enough to warn. v2: rebased Suggested-by: Ben Widawsky Signed-off-by: Mika Kuoppala Reviewed-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_uncore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index 00320fd..79eaba8 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -988,9 +988,10 @@ static int gen6_do_reset(struct drm_device *dev) dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_engine); if (IS_GEN6(dev) || IS_GEN7(dev)) - dev_priv->uncore.fifo_count = - __raw_i915_read32(dev_priv, GTFIFOCTL) & - GT_FIFO_FREE_ENTRIES_MASK; + WARN_ON((__raw_i915_read32(dev_priv, GTFIFOCTL) & + GT_FIFO_FREE_ENTRIES_MASK) != 0); + + dev_priv->uncore.fifo_count = 0; spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); return ret;