From: Russell King - ARM Linux Subject: Kernel warning when mode setting with no connectors connected Date: Sat, 12 Apr 2014 11:32:29 +0100 Message-ID: <20140412103229.GU16119@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from pandora.arm.linux.org.uk (gw-1.arm.linux.org.uk [78.32.30.217]) by gabe.freedesktop.org (Postfix) with ESMTP id ABDC86E51E for ; Sat, 12 Apr 2014 03:33:11 -0700 (PDT) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: airlied@linux.ie, dri-devel@lists.freedesktop.org, Daniel Vetter List-Id: dri-devel@lists.freedesktop.org Hi, I've been seeing the following warning when a mode is attempted to be set after boot when no display connectors are connected. This typically happens if your platform has just a HDMI output, and the TV connected to the HDMI output is fully powered off. This has been happening for quite some time now... I should've probably reported it earlier. I've seen it both with imx-drm and armada-drm. WARNING: CPU: 0 PID: 846 at drivers/gpu/drm/drm_crtc.c:2074 drm_mode_set_config_internal+0xd0/0xd8() Modules linked in: rfcomm bnep bluetooth 6lowpan_iphc brcmfmac brcmutil snd_soc_fsl_spdif imx_pcm_dma imx_sdma imx_thermal imx2_wdt snd_soc_imx_spdif nfsd exportfs CPU: 0 PID: 846 Comm: Xorg Not tainted 3.14.0+ #1027 Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r6:0000081a r5:00000009 r4:00000000 r3:00000000 [] (show_stack) from [] (dump_stack+0x74/0x90) [] (dump_stack) from [] (warn_slowpath_common+0x70/0x90) r4:00000000 r3:c09344b8 [] (warn_slowpath_common) from [] (warn_slowpath_null+0x24/0x2c) r8:ea3c3818 r7:00000001 r6:e9904500 r5:00000000 r4:ea3c3818 [] (warn_slowpath_null) from [] (drm_mode_set_config_internal+0xd0/0xd8) [] (drm_mode_set_config_internal) from [] (drm_mode_setcrtc+0x378/0x4b4) r6:ea3c3400 r5:e8d78b00 r4:e9981e48 r3:00000000 [] (drm_mode_setcrtc) from [] (drm_ioctl+0x3f4/0x498) r10:c06b8fa0 r9:e9981e48 r8:e9981e48 r7:e9980000 r6:e98260c0 r5:000000a2 r4:ea3c3400 [] (drm_ioctl) from [] (do_vfs_ioctl+0x80/0x5d4) r10:00000000 r9:e9980000 r8:00000006 r7:c06864a2 r6:be911850 r5:e9826900 r4:ea3bf100 [] (do_vfs_ioctl) from [] (SyS_ioctl+0x40/0x5c) r9:e9980000 r8:00000006 r7:c06864a2 r6:be911850 r5:e9826900 r4:e9826900 [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x30) r8:c000e864 r7:00000036 r6:00000006 r5:c06864a2 r4:be911850 r3:00000001 ---[ end trace 46155b08f61d1185 ]--- In drm_mode_set_config_internal(), this check is done: fb = set->fb; ret = crtc->funcs->set_config(set); if (ret == 0) { /* crtc->fb must be updated by ->set_config, enforces this. */ WARN_ON(fb != crtc->fb); } However, drm_crtc_helper_set_config() does this: if (!set->mode) set->fb = NULL; if (set->fb) { ... } else { DRM_DEBUG_KMS("[CRTC:%d] [NOFB]\n", set->crtc->base.id); return drm_crtc_helper_disable(set->crtc); } which results in a zero return with crtc->fb set to NULL, possibly being different to what set->fb was originally. I haven't debugged this fully yet as the only side effect is the warning. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it.