From patchwork Sun Nov 5 13:39:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sagar.a.kamble@intel.com X-Patchwork-Id: 10042155 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 631EE6032D for ; Sun, 5 Nov 2017 13:36:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F67C291D6 for ; Sun, 5 Nov 2017 13:36:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 448A22957D; Sun, 5 Nov 2017 13:36:18 +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 0099B291D6 for ; Sun, 5 Nov 2017 13:36:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 505E96E1B2; Sun, 5 Nov 2017 13:36:17 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8C8B66E1B2 for ; Sun, 5 Nov 2017 13:36:16 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2017 05:36:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,347,1505804400"; d="scan'208";a="171707953" Received: from sakamble-desktop.iind.intel.com ([10.223.26.118]) by fmsmga005.fm.intel.com with ESMTP; 05 Nov 2017 05:36:14 -0800 From: Sagar Arun Kamble To: intel-gfx@lists.freedesktop.org Date: Sun, 5 Nov 2017 19:09:41 +0530 Message-Id: <1509889183-2094-3-git-send-email-sagar.a.kamble@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509889183-2094-1-git-send-email-sagar.a.kamble@intel.com> References: <1509889183-2094-1-git-send-email-sagar.a.kamble@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/5] drm/i915/guc: Deactivate all client doorbells before reset 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Prior to i915 reset, we need to deactivate all client doorbells as they will need to be reacquired again post reset. We should not execute GuC doorbell deallocation flow as GuC might be in bad state (possibly reason for i915 reset). Signed-off-by: Sagar Arun Kamble Cc: Chris Wilson Cc: MichaƂ Winiarski Cc: Michel Thierry Cc: Michal Wajdeczko Cc: Arkadiusz Hiler Cc: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_gem.c | 2 ++ drivers/gpu/drm/i915/i915_guc_submission.c | 14 ++++++++++++++ drivers/gpu/drm/i915/i915_guc_submission.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index cbce714..879e318 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2963,6 +2963,8 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) i915_gem_revoke_fences(dev_priv); + i915_guc_clients_reset_prepare(&dev_priv->guc); + return err; } diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index b989edf..21f7fa7 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -1113,6 +1113,20 @@ void i915_guc_clients_release_doorbells(struct intel_guc *guc) destroy_doorbell(guc->execbuf_client, true); } +void i915_guc_clients_reset_prepare(struct intel_guc *guc) +{ + if (!i915_modparams.enable_guc_submission) + return; + + /* + * We are only deactivating doorbell unit monitoring. GuC might + * be in bad state and will be reset hence don't execute GuC + * doorbell deallocation flow. + */ + destroy_doorbell(guc->preempt_client, false); + destroy_doorbell(guc->execbuf_client, false); +} + static void guc_policy_init(struct guc_policy *policy) { policy->execution_quantum = POLICY_DEFAULT_EXECUTION_QUANTUM_US; diff --git a/drivers/gpu/drm/i915/i915_guc_submission.h b/drivers/gpu/drm/i915/i915_guc_submission.h index 1d5cf22..91ad505 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.h +++ b/drivers/gpu/drm/i915/i915_guc_submission.h @@ -74,6 +74,7 @@ struct i915_guc_client { void i915_guc_clients_acquire_doorbells(struct intel_guc *guc); void i915_guc_clients_release_doorbells(struct intel_guc *guc); +void i915_guc_clients_reset_prepare(struct intel_guc *guc); int i915_guc_submission_init(struct drm_i915_private *dev_priv); int i915_guc_submission_enable(struct drm_i915_private *dev_priv); void i915_guc_submission_disable(struct drm_i915_private *dev_priv);