From patchwork Tue Jul 9 20:14:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 2825434 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 3D3DBC0AB2 for ; Tue, 9 Jul 2013 20:14:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 50F6A20173 for ; Tue, 9 Jul 2013 20:14:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 055E520168 for ; Tue, 9 Jul 2013 20:14:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 11D5CE5FB3 for ; Tue, 9 Jul 2013 13:14:32 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by gabe.freedesktop.org (Postfix) with ESMTP id 26CF7E5D51; Tue, 9 Jul 2013 13:14:20 -0700 (PDT) Received: by mail-pa0-f46.google.com with SMTP id fa11so5913462pad.19 for ; Tue, 09 Jul 2013 13:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=PLl2qq/3uwtOOUVskBtCXCPVKwdZuBCbfWR/so+raXQ=; b=WtCzb4Jj2Ysvwu0OsmDsMM847LkzXGB+gB7MtQWZ1hRhqLKnA8DF/q7IiLvfA1YnVY VWoNDMlhsGIuuggyR1sg+MQG3nPqwt9ECbTsZZcxkVzGYnSBrlvzIB2SZSrJ0riHLrVQ y0uIrrXPfF9h2LpKD5zPO4DcA6EtXYcUMcBXMt+IjiRyqEDY79o1cZW2qIZfAchk25cF iph21SfBRsJkjzUWfDDbUp60FNh+hlzQS6ml0poaIDBZdc9MszMhUANLNSiXAClEOrHp rrCYD8vyCOOPutHAwF/vWHvgP9bgGJCYIoJmTUH9t7jpQlhAT+ecUO/SNiBti0Mi7NmH EFpg== X-Received: by 10.66.27.44 with SMTP id q12mr29732104pag.138.1373400860003; Tue, 09 Jul 2013 13:14:20 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id ry2sm29783262pbc.41.2013.07.09.13.14.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 09 Jul 2013 13:14:19 -0700 (PDT) From: Guenter Roeck To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 9 Jul 2013 13:14:09 -0700 Message-Id: <1373400849-30351-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 Cc: David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, Guenter Roeck , Mika Kuoppala Subject: [Intel-gfx] [PATCH] Revert "drm/i915: unconditionally use mt forcewake on hsw/ivb" 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 This reverts commit 36ec8f877481449bdfa072e6adf2060869e2b970. The commit results in repeated 'Timed out waiting for forcewake old ack to clear' messages on a Supermicro C7H61 board (BIOS version 2.00 and 2.00b) with i7-3770K CPU. It ultimately results in a hangup if the system is highly loaded. Reverting the commit fixes the issue. While I understand that this should be fixed in the BIOS, a more recent BIOS is not available fron the vendor. If/since no better solution is not available, reverting the patch seems to be the way to go (otherwise me and others with the same problem won't be able to run the upstream kernel on affected boards). Cc: Jesse Barnes Cc: Daniel Vetter Cc: Mika Kuoppala Signed-off-by: Guenter Roeck --- drivers/gpu/drm/i915/intel_pm.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index aa01128..5bae9ba 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -4510,12 +4510,35 @@ void intel_gt_init(struct drm_device *dev) if (IS_VALLEYVIEW(dev)) { dev_priv->gt.force_wake_get = vlv_force_wake_get; dev_priv->gt.force_wake_put = vlv_force_wake_put; - } else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) { - dev_priv->gt.force_wake_get = __gen6_gt_force_wake_mt_get; - dev_priv->gt.force_wake_put = __gen6_gt_force_wake_mt_put; - } else if (IS_GEN6(dev)) { + } else if (INTEL_INFO(dev)->gen >= 6) { dev_priv->gt.force_wake_get = __gen6_gt_force_wake_get; dev_priv->gt.force_wake_put = __gen6_gt_force_wake_put; + + /* IVB configs may use multi-threaded forcewake */ + if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) { + u32 ecobus; + + /* A small trick here - if the bios hasn't configured + * MT forcewake, and if the device is in RC6, then + * force_wake_mt_get will not wake the device and the + * ECOBUS read will return zero. Which will be + * (correctly) interpreted by the test below as MT + * forcewake being disabled. + */ + mutex_lock(&dev->struct_mutex); + __gen6_gt_force_wake_mt_get(dev_priv); + ecobus = I915_READ_NOTRACE(ECOBUS); + __gen6_gt_force_wake_mt_put(dev_priv); + mutex_unlock(&dev->struct_mutex); + + if (ecobus & FORCEWAKE_MT_ENABLE) { + DRM_DEBUG_KMS("Using MT version of forcewake\n"); + dev_priv->gt.force_wake_get = + __gen6_gt_force_wake_mt_get; + dev_priv->gt.force_wake_put = + __gen6_gt_force_wake_mt_put; + } + } } INIT_DELAYED_WORK(&dev_priv->rps.delayed_resume_work, intel_gen6_powersave_work);