From patchwork Wed Mar 19 00:41:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 3850071 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 3CF419F334 for ; Wed, 19 Mar 2014 00:42:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50CB220270 for ; Wed, 19 Mar 2014 00:42:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 144C82015D for ; Wed, 19 Mar 2014 00:41:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C4E16E24E; Tue, 18 Mar 2014 17:41:58 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 61AC06E24E for ; Tue, 18 Mar 2014 17:41:57 -0700 (PDT) Received: by mail-pd0-f172.google.com with SMTP id p10so7851726pdj.31 for ; Tue, 18 Mar 2014 17:41:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=RSIsxaKpsZp06wnSTDuBkwkqqiCY0u6UFZJSEoSJrKA=; b=fi4svwBz6EHSw9ldN2JeeVdeuHWCXPEKBh0CksNKEJhp+v8NrFSZU7Jg3sqKHs9O7K BwqgIVgfZ1PbD4e9mqP1HGZrMIZS+oKsZ4cL7G0DwaNpJhmI4FiIQg2jjVnDEbQpVVU9 fzXJsuG5BB9qWaVqO0+fhcbNq71zmFL8MvvSTNZyrxoVnMvlh5BlYjgzSwOAsgEFYoTY dU8sWa1QOfLG4p35DqngOcqC2eN/5jTdy6XAQLwp679I1zL0kMVlhy8twn1k769CBY7V iY5mHvlBl95d2Xe4V86GT69Qhar9hIYzD6YkX6vC2pBNTLF2RBYxockjgonouBW/iWF5 7mxA== X-Gm-Message-State: ALoCoQnQ1fZBzLs6m9VcP76QWVUjpv7az/N3a5NKlR6qqBuyJDeKevzP/tf/uf18myv6MBen5Lza X-Received: by 10.66.180.200 with SMTP id dq8mr36250175pac.104.1395189717154; Tue, 18 Mar 2014 17:41:57 -0700 (PDT) Received: from intel.com (jfdmzpr03-ext.jf.intel.com. [134.134.139.72]) by mx.google.com with ESMTPSA id x9sm56588104pbu.1.2014.03.18.17.41.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Mar 2014 17:41:56 -0700 (PDT) Date: Tue, 18 Mar 2014 17:41:54 -0700 From: Ben Widawsky To: Daniel Vetter Message-ID: <20140319004154.GI30656@intel.com> References: <1395156663-27627-1-git-send-email-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1395156663-27627-1-git-send-email-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Intel Graphics Development , Mika Kuoppala Subject: Re: [Intel-gfx] [PATCH] drm/i915: Fix up the forcewake timer initialization 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: , 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 On Tue, Mar 18, 2014 at 04:31:03PM +0100, Daniel Vetter wrote: > This is a regression introduced in > > commit 0294ae7b44bba7ab0d4cef9a8736287f38bdb4fd > Author: Chris Wilson > Date: Thu Mar 13 12:00:29 2014 +0000 > > drm/i915: Consolidate forcewake resetting to a single function > > The reordered setup sequence ended up calling del_timer_sync before > the timer was set up correctly, resulting in endless hilarity when > loading the driver. > > Compared to Ben's patch (which moved around the setup_timer call to > sanitize_early) this moves the sanitize_early call around in the > driver load call. This way we avoid calling setup_timer again in the > resume code (where we also call sanitize_early). > > Cc: Chris Wilson > Cc: Mika Kuoppala > Cc: Ben Widawsky > Tested-by: Rodrigo Vivi > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76242 > Signed-off-by: Daniel Vetter > --- > drivers/gpu/drm/i915/i915_dma.c | 2 -- > drivers/gpu/drm/i915/intel_uncore.c | 2 ++ > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c > index e4d2b9f15ae2..9faee49f210d 100644 > --- a/drivers/gpu/drm/i915/i915_dma.c > +++ b/drivers/gpu/drm/i915/i915_dma.c > @@ -1608,8 +1608,6 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) > goto put_bridge; > } > > - intel_uncore_early_sanitize(dev); > - > /* This must be called before any calls to HAS_PCH_* */ > intel_detect_pch(dev); > > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c > index e2e328d86aff..c3832d9270a6 100644 > --- a/drivers/gpu/drm/i915/intel_uncore.c > +++ b/drivers/gpu/drm/i915/intel_uncore.c > @@ -736,6 +736,8 @@ void intel_uncore_init(struct drm_device *dev) > setup_timer(&dev_priv->uncore.force_wake_timer, > gen6_force_wake_timer, (unsigned long)dev_priv); > > + intel_uncore_early_sanitize(dev); > + > if (IS_VALLEYVIEW(dev)) { > dev_priv->uncore.funcs.force_wake_get = __vlv_force_wake_get; > dev_priv->uncore.funcs.force_wake_put = __vlv_force_wake_put; If you only want to setup_timer once, the setup_timer call should be in intel_uncore_init() which is the only one called only at load time. And of course, this is where the bug is. Otherwise, thaw calls uncore_early_sanitize, which will setup_timer again (which I thought was your complaint with my original patch). How about this, (only minimally tested): diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index e2e328d..7ef5aa3 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -387,8 +387,6 @@ void intel_uncore_early_sanitize(struct drm_device *dev) if (IS_GEN6(dev) || IS_GEN7(dev)) __raw_i915_write32(dev_priv, GTFIFODBG, __raw_i915_read32(dev_priv, GTFIFODBG)); - - intel_uncore_forcewake_reset(dev, false); } void intel_uncore_sanitize(struct drm_device *dev) @@ -413,6 +411,8 @@ void intel_uncore_sanitize(struct drm_device *dev) mutex_unlock(&dev_priv->rps.hw_lock); } + + intel_uncore_forcewake_reset(dev, false); } /* @@ -846,7 +846,6 @@ void intel_uncore_fini(struct drm_device *dev) { /* Paranoia: make sure we have disabled everything before we exit. */ intel_uncore_sanitize(dev); - intel_uncore_forcewake_reset(dev, false); }