From patchwork Tue Aug 13 18:55:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?St=C3=A9phane_Marchesin?= X-Patchwork-Id: 2843960 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 7AC58BF546 for ; Tue, 13 Aug 2013 19:07:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 60AC42064B for ; Tue, 13 Aug 2013 19:07:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 64A5320643 for ; Tue, 13 Aug 2013 19:07:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 662DBE7BA6 for ; Tue, 13 Aug 2013 12:07:49 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by gabe.freedesktop.org (Postfix) with ESMTP id B429FE7B4C for ; Tue, 13 Aug 2013 11:55:20 -0700 (PDT) Received: by mail-pd0-f181.google.com with SMTP id g10so5287255pdj.26 for ; Tue, 13 Aug 2013 11:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=5Ymk2y0IrsfKrDgx+vT7DgK9TdKPz4N6O/LHNPXX2ck=; b=H2ZnNrwAojs/Lhrcy/FZ7C/i2aNgBayJ51vjSKAkifIfJAKbrtVxseWVP47KlxvONd LE73bg05i8LtMq/mlFoLX7QFz57gdqGr3HpVbx6wZVhpDPqXqbZk/gbTFK+5wgdd4Dua uHv4edshpBFi/3KIhbFS8dDuJESoO25+sDbCw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-type:content-transfer-encoding; bh=5Ymk2y0IrsfKrDgx+vT7DgK9TdKPz4N6O/LHNPXX2ck=; b=iYxsOKnxy0RGfZfrXqP4uozcEXMX7cHhrEs8KROAo5tLqrDzu2Lk0EYwibCb7755tp 1+UT/bdzslykpGUWiGtk5Q0rxxIg1wWe480fSgDX1KGIB9BslG0OUwDWkj9mEJBuM4Lv KK/a1OIB7oaT82lXAHEV8ax5yxoD0rqFhpwT/rbPwXVU+dxdBjSSQFdaeyVDyVkwBBL0 07EWRLDs/c3ybuUKAzox+whJ+CBy69NKfJnGYgPhZSCUnH2+cQr1xdP6gQiz3AeYfcUh gB4KJA1M0TqqpENmK0OI9gV4tWcfvyYS18/L00es0lyfuXbKvlwyDBCA7chE77+4r76Z qh8g== X-Gm-Message-State: ALoCoQncQdo9VEjDnljWXj7cav88TSt+N6HNGmyPCZJatdLGY55EuM2nG8T+2tyM2nRO/Jj5ocB+ X-Received: by 10.68.225.195 with SMTP id rm3mr5943485pbc.70.1376420120250; Tue, 13 Aug 2013 11:55:20 -0700 (PDT) Received: from localhost ([2620:0:1000:1b01:82c1:6eff:fef8:b068]) by mx.google.com with ESMTPSA id hk3sm3913116pbb.3.2013.08.13.11.55.18 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 11:55:19 -0700 (PDT) From: =?UTF-8?q?St=C3=A9phane=20Marchesin?= To: intel-gfx@lists.freedesktop.org Date: Tue, 13 Aug 2013 11:55:17 -0700 Message-Id: <1376420117-3073-1-git-send-email-marcheu@chromium.org> X-Mailer: git-send-email 1.8.3 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: tune the RC6 threshold for stability 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: , 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=-6.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 It's basically the same deal as the RC6+ issues on ivy bridge except this time with RC6 on sandy bridge. Like last time the core of the issue is that the timings don't work 100% with our voltage regulator. So from time to time, the kernel will print a warning message about the GPU not getting out of RC6. In particular, I found this fairly easy to reproduce during suspend/resume. Changing the threshold to 125000 instead of 50000 seems to fix the issue. The previous patch used 150000 but as it turns out this doesn't work everywhere. After getting such a machine, I bisected the highest value which works, which is 125000, so here it is. I also measured the idle power usage before/after this patch and didn't see a difference on a sandy bridge laptop. On haswell and up, it makes a big difference, so we want to keep it at 50k there. It also seems like haswell doesn't have the RC6 issues that sandy bridge has so the 50k value is fine. Signed-off-by: Stéphane Marchesin --- drivers/gpu/drm/i915/intel_pm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 51a2a60..71839f8 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c @@ -3250,7 +3250,10 @@ static void gen6_enable_rps(struct drm_device *dev) I915_WRITE(GEN6_RC_SLEEP, 0); I915_WRITE(GEN6_RC1e_THRESHOLD, 1000); - I915_WRITE(GEN6_RC6_THRESHOLD, 50000); + if (INTEL_INFO(dev)->gen <= 6 || IS_IVYBRIDGE(dev)) + I915_WRITE(GEN6_RC6_THRESHOLD, 125000); + else + I915_WRITE(GEN6_RC6_THRESHOLD, 50000); I915_WRITE(GEN6_RC6p_THRESHOLD, 150000); I915_WRITE(GEN6_RC6pp_THRESHOLD, 64000); /* unused */