From patchwork Wed Mar 16 15:11:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Feceoru, Gabriel" X-Patchwork-Id: 8601711 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 30EBBC0553 for ; Wed, 16 Mar 2016 15:13:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 538D620211 for ; Wed, 16 Mar 2016 15:13:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 377F02020F for ; Wed, 16 Mar 2016 15:13:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 193FF6E957; Wed, 16 Mar 2016 15:13:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 35CAE6E957 for ; Wed, 16 Mar 2016 15:13:30 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 16 Mar 2016 08:12:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,345,1455004800"; d="scan'208";a="938501590" Received: from gfeceoru-ms-7924.rb.intel.com ([10.237.104.199]) by fmsmga002.fm.intel.com with ESMTP; 16 Mar 2016 08:12:26 -0700 From: Gabriel Feceoru To: intel-gfx@lists.freedesktop.org Date: Wed, 16 Mar 2016 17:11:44 +0200 Message-Id: <1458141104-18137-1-git-send-email-gabriel.feceoru@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH] drm/i915: Release power ref after updating wm X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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, 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 HSW/BDW there are random dmesg-warn errors while running kms tests, like: [90587.867077] Call Trace: [90587.867085] [] dump_stack+0x67/0x99 [90587.867094] [] warn_slowpath_common+0x81/0xc0 [90587.867099] [] warn_slowpath_fmt+0x47/0x50 [90587.867150] [] hsw_write32+0x280/0x290 [i915] [90587.867186] [] _ilk_disable_lp_wm+0x98/0xd0 [i915] [90587.867222] [] ilk_program_watermarks+0x4a2/0x940 [i915] [90587.867260] [] ilk_optimize_watermarks+0x50/0x70 [i915] [90587.867311] [] intel_atomic_commit+0x742/0x2170 [i915] [90587.867319] [] ? wait_woken+0xa0/0xa0 [90587.867326] [] drm_atomic_commit+0x32/0x50 [90587.867333] [] drm_atomic_helper_connector_dpms+0xe9/0x1a0 [90587.867340] [] drm_mode_obj_set_property_ioctl+0x21d/0x230 [90587.867346] [] drm_mode_connector_property_set_ioctl+0x2b/0x30 [90587.867352] [] drm_ioctl+0x236/0x4f0 [90587.867358] [] ? drm_mode_obj_set_property_ioctl+0x230/0x230 [90587.867366] [] do_vfs_ioctl+0x8e/0x680 [90587.867372] [] ? __fget_light+0x6a/0x90 [90587.867378] [] SyS_ioctl+0x3c/0x70 [90587.867386] [] entry_SYSCALL_64_fastpath+0x16/0x73 Since writing the watermarks requires MMIO access, this should be done before releasing the power reference. This clears the flip-flops in kms tests on HSW/BDW. Signed-off-by: Gabriel Feceoru --- drivers/gpu/drm/i915/intel_display.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index ce55f0b..b141e52 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -13631,9 +13631,6 @@ static int intel_atomic_commit(struct drm_device *dev, modeset_put_power_domains(dev_priv, put_domains[i]); } - if (intel_state->modeset) - intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET); - /* * Now that the vblank has passed, we can go ahead and program the * optimal watermarks on platforms that need two-step watermark @@ -13648,6 +13645,9 @@ static int intel_atomic_commit(struct drm_device *dev, dev_priv->display.optimize_watermarks(intel_cstate); } + if (intel_state->modeset) + intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET); + mutex_lock(&dev->struct_mutex); drm_atomic_helper_cleanup_planes(dev, state); mutex_unlock(&dev->struct_mutex);