From patchwork Thu Aug 9 20:33:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1302871 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id B76EC3FC23 for ; Thu, 9 Aug 2012 20:34:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B54D9A0F45 for ; Thu, 9 Aug 2012 13:34:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 772CEA0F4D for ; Thu, 9 Aug 2012 13:33:42 -0700 (PDT) Received: by wgbdr1 with SMTP id dr1so625084wgb.12 for ; Thu, 09 Aug 2012 13:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer; bh=Nk6r5ErErtaaARSAb48KTKW9ggh7U+Z9Bu6b2KNNB5o=; b=FWZFLW/tAzhN97HH94bn+LJEK98OzGnVvC28FEmXETFJ5j/s80QQsIB09CppsekDiZ XsVBuuO45apke/Vyo0yThu27MM/Al9PSEsyBYGVEIBEJGdj51n3O7FHajz8Qs68d9NJv CNfnFrK2WZDRf4Ipf/Zk2FfaNHwEBew6U9xJA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=Nk6r5ErErtaaARSAb48KTKW9ggh7U+Z9Bu6b2KNNB5o=; b=bHKWOyeiQN9fJUDNVylZRRuQihAYs8Wx46lYSsTvKihxTdHagRh1TU78jdXpL8/VUJ rTuS1KPBTMDJNYZ1GFi7+ZnU9wrhyYpvhNb5XD47LHjJlgbQhlEafcDprPfkDUmPkPku K7SF/fYR5PYFwqguelnj+hR+WTM/fGYVnRc4oVBRSBtcOMvxcRKyjy7d7tSJ1zuggCkE U8d8ApKb+eu+Ss/3fRGjDFmEd17b6wClVwUY9V9rBAmh+dbXbXGMJorpZAtskgJtdTp0 ltnJ3zJw5HtiCoXfKLaT1vDWW1l11zzONs2OH9rNV6Q/+mwnvjw5cNb3It//BiehzlQ9 OhKg== Received: by 10.180.82.164 with SMTP id j4mr1265687wiy.18.1344544421549; Thu, 09 Aug 2012 13:33:41 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id h9sm3674348wiz.1.2012.08.09.13.33.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Aug 2012 13:33:40 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 9 Aug 2012 22:33:58 +0200 Message-Id: <1344544438-5654-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQmlrcbak2ZK7cnqQjgZBcKclVizNMRXZLCqXYFhU4JbEJzLRJDf1DtSRTAPBno4N6CewW3M Cc: Daniel Vetter , Ben Widawsky Subject: [Intel-gfx] [PATCH] drm/i915: don't grab dev->struct_mutex for userspace forcewak 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 Since forcewake is now protected by a spinlock, we don't need to grab dev->struct_mutex any more. This way we can also get rid of a stale comment, noticed by Ben Widawsky while reviewing some locking changes. Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_debugfs.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index ed4bc98..5f3bb5e 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1961,11 +1961,7 @@ static int i915_forcewake_open(struct inode *inode, struct file *file) if (INTEL_INFO(dev)->gen < 6) return 0; - ret = mutex_lock_interruptible(&dev->struct_mutex); - if (ret) - return ret; gen6_gt_force_wake_get(dev_priv); - mutex_unlock(&dev->struct_mutex); return 0; } @@ -1974,24 +1970,11 @@ static int i915_forcewake_release(struct inode *inode, struct file *file) { struct drm_device *dev = inode->i_private; struct drm_i915_private *dev_priv = dev->dev_private; - int ret; if (INTEL_INFO(dev)->gen < 6) return 0; - /* - * It's bad that we can potentially hang userspace if struct_mutex gets - * forever stuck. However, if we cannot acquire this lock it means that - * almost certainly the driver has hung, is not unload-able. Therefore - * hanging here is probably a minor inconvenience not to be seen my - * almost every user. - */ - ret = mutex_lock_interruptible(&dev->struct_mutex); - if (ret) - return ret; - gen6_gt_force_wake_put(dev_priv); - mutex_unlock(&dev->struct_mutex); return 0; }