From patchwork Tue Jul 14 11:00:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 6786481 Return-Path: X-Original-To: patchwork-dri-devel@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 22355C05AC for ; Tue, 14 Jul 2015 11:00:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 371F2206E7 for ; Tue, 14 Jul 2015 11:00:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0A665206E5 for ; Tue, 14 Jul 2015 11:00:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 47E506E42B; Tue, 14 Jul 2015 04:00:43 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id A61246E42B for ; Tue, 14 Jul 2015 04:00:41 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 14 Jul 2015 04:00:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,471,1432623600"; d="scan'208";a="764090834" Received: from cfinn-mobl.ger.corp.intel.com (HELO patser.lan) ([10.252.21.57]) by orsmga002.jf.intel.com with ESMTP; 14 Jul 2015 04:00:39 -0700 Message-ID: <55A4EBD7.3050406@linux.intel.com> Date: Tue, 14 Jul 2015 13:00:39 +0200 From: Maarten Lankhorst User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: =?UTF-8?B?SsO2cmcgT3R0ZQ==?= Subject: [PATCH] drm/i915: Do not call intel_crtc_disable if the crtc is already disabled. References: <20150713062222.GG3736@phenom.ffwll.local> <55A3678B.6080803@linux.intel.com> <55A36FA7.7010707@linux.intel.com> In-Reply-To: Cc: Linus Torvalds , Linux Kernel Mailing List , DRI X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.6 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 When resuming with dpms off, the following warn can happen: [ 118.334082] ------------[ cut here ]------------ [ 118.334105] WARNING: CPU: 2 PID: 2274 at drivers/gpu/drm/i915/intel_display.c:6319 __intel_set_mode+0xae5/0xb90 [i915]() [ 118.334106] WARN_ON(!crtc->state->enable) [ 118.334137] Modules linked in: i915 [ 118.334139] CPU: 2 PID: 2274 Comm: kworker/u16:117 Not tainted 4.2.0-rc2-fixes+ #4148 [ 118.334140] Hardware name: LENOVO 2349AV8/2349AV8, BIOS G1ETA5WW (2.65 ) 04/15/2014 [ 118.334144] Workqueue: events_unbound async_run_entry_fn [ 118.334147] ffffffffc017eef0 ffff8800ada93998 ffffffff817aa62a 0000000080000001 [ 118.334149] ffff8800ada939e8 ffff8800ada939d8 ffffffff810807e1 ffff8800ada939c8 [ 118.334151] ffff8800cea3b3d8 0000000000000000 ffff8800ad86b008 ffff880117705668 [ 118.334151] Call Trace: [ 118.334155] [] dump_stack+0x4f/0x7b [ 118.334157] [] warn_slowpath_common+0x81/0xc0 [ 118.334158] [] warn_slowpath_fmt+0x41/0x50 [ 118.334173] [] __intel_set_mode+0xae5/0xb90 [i915] [ 118.334188] [] ? intel_modeset_compute_config+0x52/0xb40 [i915] [ 118.334191] [] ? drm_atomic_set_fb_for_plane+0x63/0x80 [ 118.334205] [] intel_set_mode+0x29/0x60 [i915] [ 118.334219] [] intel_crtc_restore_mode+0x13a/0x1f0 [i915] [ 118.334232] [] ? gen6_write16+0x250/0x250 [i915] [ 118.334246] [] intel_modeset_setup_hw_state+0x89c/0xcd0 [i915] [ 118.334248] [] ? pci_pm_thaw+0x90/0x90 [ 118.334255] [] i915_drm_resume+0xcb/0x160 [i915] [ 118.334262] [] i915_pm_resume+0x22/0x30 [i915] [ 118.334263] [] pci_pm_resume+0x63/0xa0 [ 118.334266] [] dpm_run_callback+0x70/0x420 [ 118.334267] [] device_resume+0x9d/0x1c0 [ 118.334269] [] ? initcall_debug_start+0x60/0x60 [ 118.334270] [] async_resume+0x1c/0x50 [ 118.334271] [] async_run_entry_fn+0x34/0xd0 [ 118.334273] [] process_one_work+0x1dd/0x7e0 [ 118.334275] [] ? process_one_work+0x14a/0x7e0 [ 118.334276] [] worker_thread+0x49/0x450 [ 118.334278] [] ? process_one_work+0x7e0/0x7e0 [ 118.334280] [] kthread+0xf9/0x110 [ 118.334282] [] ? insert_kthread_work+0x90/0x90 [ 118.334284] [] ret_from_fork+0x3f/0x70 [ 118.334286] [] ? insert_kthread_work+0x90/0x90 [ 118.334287] ---[ end trace 01f2cf6371b82d7a ]--- This warn is harmless, and can be fixed by not calling intel_crtc_disable when the crtc is already disabled. Reported-and-Tested-by: Jörg Otte Signed-off-by: Maarten Lankhorst diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 85ac6d85dc39..30e0f54ba19d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6315,9 +6315,6 @@ static void intel_crtc_disable(struct drm_crtc *crtc) struct drm_connector *connector; struct drm_i915_private *dev_priv = dev->dev_private; - /* crtc should still be enabled when we disable it. */ - WARN_ON(!crtc->state->enable); - intel_crtc_disable_planes(crtc); dev_priv->display.crtc_disable(crtc); dev_priv->display.off(crtc); @@ -12591,7 +12588,8 @@ static int __intel_set_mode(struct drm_crtc *modeset_crtc, continue; if (!crtc_state->enable) { - intel_crtc_disable(crtc); + if (crtc->state->enable) + intel_crtc_disable(crtc); } else if (crtc->state->enable) { intel_crtc_disable_planes(crtc); dev_priv->display.crtc_disable(crtc);