From patchwork Wed Nov 15 18:30:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michel Thierry X-Patchwork-Id: 10060045 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 20E736019D for ; Wed, 15 Nov 2017 18:30:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 157C72A03C for ; Wed, 15 Nov 2017 18:30:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A6BA2A1F5; Wed, 15 Nov 2017 18:30:35 +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 BFF7C2A03C for ; Wed, 15 Nov 2017 18:30:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D3F26E67E; Wed, 15 Nov 2017 18:30:34 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36F566E675 for ; Wed, 15 Nov 2017 18:30:31 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2017 10:30:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,399,1505804400"; d="scan'208";a="2212182" Received: from relo-linux-11.sc.intel.com ([10.3.160.161]) by FMSMGA003.fm.intel.com with ESMTP; 15 Nov 2017 10:30:29 -0800 From: Michel Thierry To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Nov 2017 10:30:28 -0800 Message-Id: <20171115183029.2990-2-michel.thierry@intel.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171115183029.2990-1-michel.thierry@intel.com> References: <20171115183029.2990-1-michel.thierry@intel.com> Cc: Sujaritha Sundaresan Subject: [Intel-gfx] [RFC 2/3] drm/i915/guc: Omit guc_init_doorbell_hw during driver load 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 During driver load we create the GuC clients and allocate their doorbells just before executing guc_init_doorbell_hw; but since we just created these doorbells, how can they be out of sync? This code has had more than enough refactoring (2 more still in progress) so I would not be surprised if calling guc_init_doorbell_hw made sense at some point, but not anymore. The resume path is different, in this case the driver doesn't recreate clients, and it is still reasonable to validate/reallocate the doorbells in order to confirm that they still belong to the clients. And probably guc_init_doorbell_hw is no longer the right name, but I'll leave that to someone else. Signed-off-by: Michel Thierry Cc: Sagar Arun Kamble Cc: Sujaritha Sundaresan Cc: Michal Wajdeczko Cc: Oscar Mateo Cc: Daniele Ceraolo Spurio Cc: Chris Wilson Acked-by: Daniele Ceraolo Spurio Acked-by: Sagar Arun Kamble --- drivers/gpu/drm/i915/i915_guc_submission.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index 5d6576e01a91..d6762ca42cf1 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -1424,16 +1424,16 @@ int i915_guc_submission_enable(struct drm_i915_private *dev_priv) } else { guc_reset_wq(guc->execbuf_client); guc_reset_wq(guc->preempt_client); + + err = guc_init_doorbell_hw(guc); + if (err) + goto err_free_clients; } err = intel_guc_sample_forcewake(guc); if (err) goto err_free_clients; - err = guc_init_doorbell_hw(guc); - if (err) - goto err_free_clients; - /* Take over from manual control of ELSP (execlists) */ guc_interrupts_capture(dev_priv);