From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752977AbcHOKQf (ORCPT ); Mon, 15 Aug 2016 06:16:35 -0400 Received: from mail.kernel.org ([198.145.29.136]:37248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752748AbcHOKQe (ORCPT ); Mon, 15 Aug 2016 06:16:34 -0400 Date: Mon, 15 Aug 2016 19:16:10 +0900 From: Masami Hiramatsu To: Daniel Vetter Cc: Daniel Vetter , Jani Nikula , David Airlie , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [lockdep] drm/i915: possible circular locking dependency in i915 driver init Message-Id: <20160815191610.eea0289af63214a77f35f6ef@kernel.org> In-Reply-To: <20160815063929.GY6232@phenom.ffwll.local> References: <20160814230135.f647298f01687d84cc210ee5@kernel.org> <20160815063929.GY6232@phenom.ffwll.local> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Aug 2016 08:39:29 +0200 Daniel Vetter wrote: > On Sun, Aug 14, 2016 at 11:01:35PM +0900, Masami Hiramatsu wrote: > > Hello, > > > > I've found a suspicious circular locking dependency in i915 by lockdep. > > It seems main driver initialization thread and sub fbdev configuration > > thread take locks in different order implicitly. Please check it. > > > > The lockdep report is here. > > Should be fixed in 4.8-rc2, please confirm. Thanks! I've confirmed this has fixed on 4.8-rc2. Regards, > -Daniel > > > > > [ 4.254984] ====================================================== > > [ 4.254984] [ INFO: possible circular locking dependency detected ] > > [ 4.254985] 4.8.0-rc1+ #8 Not tainted > > [ 4.254985] ------------------------------------------------------- > > [ 4.254986] kworker/u16:1/72 is trying to acquire lock: > > [ 4.255001] (&dev->mode_config.mutex){+.+.+.}, at: [] drm_modeset_lock_all+0x40/0x130 [drm] > > [ 4.255001] > > but task is already holding lock: > > [ 4.255005] ((fb_notifier_list).rwsem){++++.+}, at: [] __blocking_notifier_call_chain+0x35/0x70 > > [ 4.255005] > > which lock already depends on the new lock. > > > > [ 4.255005] > > the existing dependency chain (in reverse order) is: > > [ 4.255006] > > -> #1 ((fb_notifier_list).rwsem){++++.+}: > > [ 4.255009] [] lock_acquire+0x100/0x1f0 > > [ 4.255011] [] down_write+0x49/0x80 > > [ 4.255013] [] blocking_notifier_chain_register+0x21/0xb0 > > [ 4.255015] [] fb_register_client+0x18/0x20 > > [ 4.255016] [] backlight_device_register+0x12e/0x250 > > [ 4.255046] [] intel_backlight_device_register+0xa2/0x160 [i915] > > [ 4.255070] [] intel_connector_register+0xe/0x10 [i915] > > [ 4.255093] [] intel_dp_connector_register+0x1b/0x80 [i915] > > [ 4.255102] [] drm_connector_register+0x4a/0x80 [drm] > > [ 4.255110] [] drm_modeset_register_all+0x1c6/0x260 [drm] > > [ 4.255116] [] drm_dev_register+0xc2/0xd0 [drm] > > [ 4.255135] [] i915_driver_load+0x771/0x1460 [i915] > > [ 4.255153] [] i915_pci_probe+0x4f/0x70 [i915] > > [ 4.255155] [] local_pci_probe+0x45/0xa0 > > [ 4.255157] [] pci_device_probe+0xe1/0x130 > > [ 4.255159] [] driver_probe_device+0x224/0x430 > > [ 4.255160] [] __driver_attach+0xe3/0xf0 > > [ 4.255160] [] bus_for_each_dev+0x66/0xa0 > > [ 4.255161] [] driver_attach+0x1e/0x20 > > [ 4.255162] [] bus_add_driver+0x200/0x270 > > [ 4.255164] [] driver_register+0x60/0xe0 > > [ 4.255165] [] __pci_register_driver+0x60/0x70 > > [ 4.255182] [] i915_init+0x5b/0x62 [i915] > > [ 4.255183] [] do_one_initcall+0x3d/0x160 > > [ 4.255186] [] do_init_module+0x5f/0x1f8 > > [ 4.255187] [] load_module+0x246c/0x2bd0 > > [ 4.255188] [] SYSC_finit_module+0xbc/0xf0 > > [ 4.255190] [] SyS_finit_module+0xe/0x10 > > [ 4.255191] [] entry_SYSCALL_64_fastpath+0x23/0xc1 > > [ 4.255192] > > -> #0 (&dev->mode_config.mutex){+.+.+.}: > > [ 4.255194] [] __lock_acquire+0x125c/0x14b0 > > [ 4.255195] [] lock_acquire+0x100/0x1f0 > > [ 4.255197] [] mutex_lock_nested+0x69/0x3b0 > > [ 4.255206] [] drm_modeset_lock_all+0x40/0x130 [drm] > > [ 4.255212] [] drm_fb_helper_restore_fbdev_mode_unlocked+0x2b/0x80 [drm_kms_helper] > > [ 4.255217] [] drm_fb_helper_set_par+0x2d/0x50 [drm_kms_helper] > > [ 4.255240] [] intel_fbdev_set_par+0x1a/0x60 [i915] > > [ 4.255242] [] fbcon_init+0x57f/0x600 > > [ 4.255244] [] visual_init+0xd6/0x130 > > [ 4.255245] [] do_bind_con_driver+0x1c1/0x3a0 > > [ 4.255246] [] do_take_over_console+0x116/0x180 > > [ 4.255247] [] do_fbcon_takeover+0x57/0xb0 > > [ 4.255249] [] fbcon_event_notify+0x658/0x750 > > [ 4.255250] [] notifier_call_chain+0x4a/0x70 > > [ 4.255251] [] __blocking_notifier_call_chain+0x4d/0x70 > > [ 4.255253] [] blocking_notifier_call_chain+0x16/0x20 > > [ 4.255254] [] fb_notifier_call_chain+0x1b/0x20 > > [ 4.255255] [] register_framebuffer+0x251/0x330 > > [ 4.255259] [] drm_fb_helper_initial_config+0x25f/0x3f0 [drm_kms_helper] > > [ 4.255282] [] intel_fbdev_initial_config+0x18/0x30 [i915] > > [ 4.255283] [] async_run_entry_fn+0x37/0x150 > > [ 4.255284] [] process_one_work+0x1e8/0x710 > > [ 4.255285] [] worker_thread+0x4b/0x4f0 > > [ 4.255286] [] kthread+0xef/0x110 > > [ 4.255287] [] ret_from_fork+0x1f/0x40 > > [ 4.255287] > > other info that might help us debug this: > > > > [ 4.255288] Possible unsafe locking scenario: > > > > [ 4.255288] CPU0 CPU1 > > [ 4.255288] ---- ---- > > [ 4.255289] lock((fb_notifier_list).rwsem); > > [ 4.255290] lock(&dev->mode_config.mutex); > > [ 4.255290] lock((fb_notifier_list).rwsem); > > [ 4.255291] lock(&dev->mode_config.mutex); > > [ 4.255291] > > *** DEADLOCK *** > > > > And i915 related kconfigs are here: > > ---- > > CONFIG_DRM_I915=m > > CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT=y > > CONFIG_DRM_I915_USERPTR=y > > CONFIG_DRM_I915_GVT=y > > # CONFIG_DRM_I915_WERROR is not set > > # CONFIG_DRM_I915_DEBUG is not set > > ---- > > > > I've hit this on my DELL XPS15 which has skylake CPU/GPU. > > > > Thanks, > > > > > > -- > > Masami Hiramatsu > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Masami Hiramatsu