From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754182AbbCFOEh (ORCPT ); Fri, 6 Mar 2015 09:04:37 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:59455 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbbCFOEe (ORCPT ); Fri, 6 Mar 2015 09:04:34 -0500 Date: Fri, 6 Mar 2015 14:04:31 +0000 From: Charles Keepax To: Inki Dae Cc: jy0922.shim@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, airlied@linux.ie, kgene@kernel.org, dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/exynos: Check for NULL dereference of crtc Message-ID: <20150306140431.GE4286@opensource.wolfsonmicro.com> References: <1424193281-30401-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> <54F9A806.6020605@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <54F9A806.6020605@samsung.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2015 at 10:13:42PM +0900, Inki Dae wrote: > On 2015년 02월 18일 02:14, Charles Keepax wrote: > > The commit "drm/exynos: remove exynos_plane_dpms" (d9ea6256) removed the > > use of the enabled flag, which means that the code may attempt to call > > win_enable on a NULL crtc. This results in the following oops on > > Hmm... it's strange. plane->funcs->destroy() is called prior to > crtc->funcs->destroy() so it should be exynos_crtc is not NULL. However, > it seems there is any corner case we didn't catch up. > > Applied. Thanks, it seems the offending path in an error path, looks like Arndale is missing some required DT setting which causes exynos_drm_load to fail: [ 1.638109] of_graph_get_next_endpoint(): no port node found in /dp-controller@145B0000 [ 1.646424] exynos-drm exynos-drm: bound 14400000.fimd (ops fimd_component_ops) [ 1.652704] /dp-controller@145B0000: could not find display-timings node [ 1.659323] /dp-controller@145B0000: no timings specified [ 1.664709] [drm:exynos_dp_bind] *ERROR* failed: of_get_videomode() : -22 [ 1.671485] exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (ops exynos_dp_ops): -22 Which ends up calling exynos_plane_destroy as part of the clean up: [ 1.698655] [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [ 1.706385] [] (show_stack) from [] (dump_stack+0x78/0xc4) [ 1.713588] [] (dump_stack) from [] (exynos_disable_plane+0x2c/0x60) [ 1.721660] [] (exynos_disable_plane) from [] (exynos_plane_destroy+0x1c/0x30) [ 1.730605] [] (exynos_plane_destroy) from [] (drm_mode_config_cleanup+0x168/0x20c) [ 1.739982] [] (drm_mode_config_cleanup) from [] (exynos_drm_load+0xac/0x12c) [ 1.748832] [] (exynos_drm_load) from [] (drm_dev_register+0xb0/0x110) [ 1.757075] [] (drm_dev_register) from [] (drm_platform_init+0x50/0xe0) [ 1.765405] [] (drm_platform_init) from [] (exynos_drm_bind+0x20/0x28) [ 1.773655] [] (exynos_drm_bind) from [] (try_to_bring_up_master.part.1+0xd8/0x114) [ 1.783027] [] (try_to_bring_up_master.part.1) from [] (component_master_add_with_match+0xb4/0x134) [ 1.793792] [] (component_master_add_with_match) from [] (exynos_drm_platform_probe+0xfc/0x124) [ 1.804207] [] (exynos_drm_platform_probe) from [] (platform_drv_probe+0x58/0xb4) [ 1.813411] [] (platform_drv_probe) from [] (driver_probe_device+0x11c/0x23c) [ 1.822261] [] (driver_probe_device) from [] (__driver_attach+0x9c/0xa0) [ 1.830679] [] (__driver_attach) from [] (bus_for_each_dev+0x64/0x98) [ 1.838838] [] (bus_for_each_dev) from [] (driver_attach+0x2c/0x30) [ 1.846824] [] (driver_attach) from [] (bus_add_driver+0xe8/0x1e4) [ 1.854722] [] (bus_add_driver) from [] (driver_register+0x88/0x104) [ 1.862794] [] (driver_register) from [] (__platform_driver_register+0x58/0x6c) [ 1.871827] [] (__platform_driver_register) from [] (exynos_drm_init+0xc8/0x124) [ 1.880936] [] (exynos_drm_init) from [] (do_one_initcall+0x90/0x1e0) [ 1.889096] [] (do_one_initcall) from [] (kernel_init_freeable+0x114/0x1e0) [ 1.897779] [] (kernel_init_freeable) from [] (kernel_init+0x18/0xfc) [ 1.905934] [] (kernel_init) from [] (ret_from_fork+0x14/0x34) Hope that helps some, afraid I am not really familiar enough with the graphics stack to chase that down much more though. Thanks, Charles