From patchwork Tue Jul 24 21:33:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1233381 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 90F76DF25A for ; Tue, 24 Jul 2012 21:18:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 802E19F0DD for ; Tue, 24 Jul 2012 14:18:44 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id D88489E860 for ; Tue, 24 Jul 2012 14:17:22 -0700 (PDT) Received: by wibhm11 with SMTP id hm11so17324wib.12 for ; Tue, 24 Jul 2012 14:17:22 -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:in-reply-to:references; bh=fmZRk0Tf/CoPf0lc6Uzf5FG9U+hq6ErFW/vnckpkyKU=; b=KrJhaZNX7Yr2WPOG3j7Xo+QfOuK6dLOSMyPFOpoOsv9Lot5tZk1PQFWCNECYK2Iojj C3m9SfhpLDvDdSeBhD3tkYxAiw3v5rlG/glrnsJqOCJUSvCvjboAixM5BexnAFSpWt4g DUzycP9hnv2552QGnKpy24FQ5s78Z8jV25VwI= 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:in-reply-to:references :x-gm-message-state; bh=fmZRk0Tf/CoPf0lc6Uzf5FG9U+hq6ErFW/vnckpkyKU=; b=OWaqIj1+Yi6MJV3WYTDQ9D1aZlO48eMV1y+Kug8Djllo52LB0hy7BdbFkRwQdbEOSl S6TTiLJD/0jnEtzfVPk+Ua+XHV/rKBnAjEeJ9/5AjlLl0zzLIJ8SKtHYzVh0i24v5JnJ cplXqxcRtTHlMVSCeD/dNliFun3fyE/PYNiFCNYUVT3CJyQSxagbP4XpnT7KEHywrxFL ab4nEwXnzRLhcJXvaGvnziPY9HhNlzD50SzdLWcnLrR5T9TC+o8e3Xv5CfzcwtrZXNlJ raDpd3Bykr+sK/bq4XVIwsgwI+L1pgrShbunESC7jne8MOn+nCMgGrDwHFghbhyw+ct+ cnog== Received: by 10.180.78.33 with SMTP id y1mr10482516wiw.3.1343164641960; Tue, 24 Jul 2012 14:17:21 -0700 (PDT) Received: from hummel.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id cl8sm6258845wib.10.2012.07.24.14.17.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 14:17:21 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Tue, 24 Jul 2012 23:33:42 +0200 Message-Id: <1343165630-21604-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343165630-21604-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343165630-21604-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQlNnFrx3ejw5yXU9aa0eUVNrO9ZM6NLwiRyyMjVNMIZ1Z9Z5w+Hs0YF5m6fN8uJhRbcf0wH Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 1/9] drm/i915: ensure rps state is properly lock-protected 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 Pure paranoia-induced patch as part of a large work to fix up the locking around intel_mark_busy/idle. At least for the gen6+ rps state, locking seems to be sane and the hw/sw state is protected by dev->struct_mutex. The only thing missing is a paranoid WARN_ON in sanitize_pm. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_pm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 85d1b1c..b6e8fbf 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3745,6 +3745,8 @@ static void gen6_sanitize_pm(struct drm_device *dev) gen6_gt_force_wake_get(dev_priv); + WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + old = limits = I915_READ(GEN6_RP_INTERRUPT_LIMITS); /* Make sure we continue to get interrupts * until we hit the minimum or maximum frequencies.