From patchwork Mon Apr 7 20:01:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 3946801 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29537BFF02 for ; Mon, 7 Apr 2014 20:02:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 511B4201FE for ; Mon, 7 Apr 2014 20:02:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 64A2E201FD for ; Mon, 7 Apr 2014 20:02:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E94416E79A; Mon, 7 Apr 2014 13:02:12 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by gabe.freedesktop.org (Postfix) with ESMTP id E8C7A6E79A for ; Mon, 7 Apr 2014 13:02:11 -0700 (PDT) Received: by mail-pb0-f50.google.com with SMTP id md12so7210090pbc.23 for ; Mon, 07 Apr 2014 13:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C/joIuoNoPPeciHgTGigkg23q4iz3oRjPLVMDBp4Aq0=; b=RNmYdmf0EcP9Z6Z3gv1xmajAuZS+fHn5dZfLDukBb3/eM634EM3hQvH5pVCSPABjM8 Qoj2JrqAvdsfQAWh24MTBc2xt1hC6dnYWTUwTfMYIztsclRB6pe13tXD4dySr8ruyNVf QkCRzvsK2UmtUUlI14ACdppsVH9/cpV0VJQmW8nYDXzMah1Vw0/8NBgS3cgkrBxQsUL0 7dGRjFrEDBw8rJLZeoUinHR7aLzIv4jIs8B9wfqLmiGy67SF+GUgNj/VdAksWEaPh75X goaV378IH0at1IFwRl3eVJ5PqxNYVxMfUvXM2eeoXTB2iKPzJQqJbekKctmxpbbC4zCs UfTg== X-Received: by 10.67.2.34 with SMTP id bl2mr33118309pad.58.1396900931754; Mon, 07 Apr 2014 13:02:11 -0700 (PDT) Received: from localhost (jfdmzpr04-ext.jf.intel.com. [134.134.137.73]) by mx.google.com with ESMTPSA id vb7sm38654992pbc.13.2014.04.07.13.02.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Apr 2014 13:02:10 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 7 Apr 2014 17:01:49 -0300 Message-Id: <1396900911-12415-5-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1396900911-12415-1-git-send-email-rodrigo.vivi@gmail.com> References: <1396900911-12415-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Mika Kuoppala Subject: [Intel-gfx] [PATCH 4/6] drm/i915: add flag to prevent dmesg spam on context banning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 From: Mika Kuoppala Piglit runner and QA are both looking at the dmesg for DRM_ERRORs with test cases. Add flag to stop_rings debugfs interface to prevent DRM_ERROR output when default context banning is being tested. References: https://bugs.freedesktop.org/show_bug.cgi?id=75876 Signed-off-by: Mika Kuoppala Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_drv.h | 18 ++++++++++++++++-- drivers/gpu/drm/i915/i915_gem.c | 5 +++-- drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 55addaa..d5cd981 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1099,8 +1099,12 @@ struct i915_gpu_error { */ wait_queue_head_t reset_queue; - /* For gpu hang simulation. */ - unsigned int stop_rings; + /* For gpu hang simulation. + * MSB for controlling DRM_ERROR with ctx bans + */ + u32 stop_rings; + +#define I915_SQUELCH_CTX_BAN_ERROR (1 << 31) /* For missed irq/seqno simulation. */ unsigned int test_irq_rings; @@ -2146,6 +2150,16 @@ static inline u32 i915_reset_count(struct i915_gpu_error *error) return ((atomic_read(&error->reset_counter) & ~I915_WEDGED) + 1) / 2; } +static inline u32 i915_stopped_rings(struct drm_i915_private *dev_priv) +{ + return dev_priv->gpu_error.stop_rings & ~I915_SQUELCH_CTX_BAN_ERROR; +} + +static inline bool i915_squelch_ban_error(struct drm_i915_private *dev_priv) +{ + return dev_priv->gpu_error.stop_rings & I915_SQUELCH_CTX_BAN_ERROR; +} + void i915_gem_reset(struct drm_device *dev); bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force); int __must_check i915_gem_object_finish_gpu(struct drm_i915_gem_object *obj); diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c70121d..7598e86 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2277,8 +2277,9 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv, if (!i915_gem_context_is_default(ctx)) { DRM_DEBUG("context hanging too fast, banning!\n"); return true; - } else if (dev_priv->gpu_error.stop_rings == 0) { - DRM_ERROR("gpu hanging too fast, banning!\n"); + } else if (!i915_stopped_rings(dev_priv)) { + if (!i915_squelch_ban_error(dev_priv)) + DRM_ERROR("gpu hanging too fast, banning!\n"); return true; } } diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 3d76ce1..275afa5 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -46,7 +46,7 @@ void __intel_ring_advance(struct intel_ring_buffer *ring) struct drm_i915_private *dev_priv = ring->dev->dev_private; ring->tail &= ring->size - 1; - if (dev_priv->gpu_error.stop_rings & intel_ring_flag(ring)) + if (i915_stopped_rings(dev_priv) & intel_ring_flag(ring)) return; ring->write_tail(ring, ring->tail); }