Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbaBKSgC (ORCPT ); Tue, 11 Feb 2014 13:36:02 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:33123 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751381AbaBKSf7 (ORCPT ); Tue, 11 Feb 2014 13:35:59 -0500 Date: Tue, 11 Feb 2014 18:35:43 +0000 From: Russell King - ARM Linux To: linux-arm-kernel@lists.infradead.org, Marek Szyprowski , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [BUG] Circular locking dependency - DRM/CMA/MM/hotplug/... Message-ID: <20140211183543.GK26684@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cubox-i4 just hit a new lockdep problem - not quite sure what to make of this - it looks like an interaction between quite a lot of locks - I suspect more than the lockdep code is reporting in its "Possible unsafe locking scenario" report. I'm hoping I've sent this to appropriate people... if anyone thinks this needs to go to someone else, please forward it. Thanks. ====================================================== [ INFO: possible circular locking dependency detected ] 3.14.0-rc2+ #517 Tainted: G W ------------------------------------------------------- Xorg/805 is trying to acquire lock: (cma_mutex){+.+.+.}, at: [] dma_release_from_contiguous+0xb8/0xf8 but task is already holding lock: (&dev->struct_mutex){+.+...}, at: [] drm_gem_object_handle_unreference_unlocked+0xdc/0x148 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&dev->struct_mutex){+.+...}: [] __lock_acquire+0x151c/0x1ca0 [] lock_acquire+0xa0/0x130 [] mutex_lock_nested+0x5c/0x3ac [] drm_gem_mmap+0x40/0xdc [] drm_gem_cma_mmap+0x14/0x2c [] mmap_region+0x3ac/0x59c [] do_mmap_pgoff+0x2c8/0x370 [] vm_mmap_pgoff+0x6c/0x9c [] SyS_mmap_pgoff+0x54/0x98 [] ret_fast_syscall+0x0/0x48 -> #4 (&mm->mmap_sem){++++++}: [] __lock_acquire+0x151c/0x1ca0 [] lock_acquire+0xa0/0x130 [] might_fault+0x6c/0x94 [] con_set_unimap+0x158/0x27c [] vt_ioctl+0x1298/0x1388 [] tty_ioctl+0x168/0xbf4 [] do_vfs_ioctl+0x84/0x664 [] SyS_ioctl+0x44/0x64 [] ret_fast_syscall+0x0/0x48 -> #3 (console_lock){+.+.+.}: [] __lock_acquire+0x151c/0x1ca0 [] lock_acquire+0xa0/0x130 [] console_lock+0x60/0x74 [] console_cpu_notify+0x28/0x34 [] notifier_call_chain+0x4c/0x8c [] __raw_notifier_call_chain+0x1c/0x24 [] __cpu_notify+0x34/0x50 [] cpu_notify_nofail+0x18/0x24 [] _cpu_down+0x100/0x244 [] cpu_down+0x30/0x44 [] cpu_subsys_offline+0x14/0x18 [] device_offline+0x94/0xbc [] online_store+0x4c/0x74 [] dev_attr_store+0x20/0x2c [] sysfs_kf_write+0x54/0x58 [] kernfs_fop_write+0xc4/0x160 [] vfs_write+0xbc/0x184 [] SyS_write+0x48/0x70 [] ret_fast_syscall+0x0/0x48 -> #2 (cpu_hotplug.lock){+.+.+.}: [] __lock_acquire+0x151c/0x1ca0 [] lock_acquire+0xa0/0x130 [] mutex_lock_nested+0x5c/0x3ac [] get_online_cpus+0x3c/0x58 [] lru_add_drain_all+0x24/0x190 [] migrate_prep+0x10/0x18 [] alloc_contig_range+0xf4/0x30c [] dma_alloc_from_contiguous+0x7c/0x130 [] __alloc_from_contiguous+0x38/0x12c [] atomic_pool_init+0x74/0x128 [] do_one_initcall+0x3c/0x164 [] kernel_init_freeable+0x104/0x1d0 [] kernel_init+0x10/0xec [] ret_from_fork+0x14/0x2c -> #1 (lock){+.+...}: [] __lock_acquire+0x151c/0x1ca0 [] lock_acquire+0xa0/0x130 [] mutex_lock_nested+0x5c/0x3ac [] lru_add_drain_all+0x1c/0x190 [] migrate_prep+0x10/0x18 [] alloc_contig_range+0xf4/0x30c [] dma_alloc_from_contiguous+0x7c/0x130 [] __alloc_from_contiguous+0x38/0x12c [] atomic_pool_init+0x74/0x128 [] do_one_initcall+0x3c/0x164 [] kernel_init_freeable+0x104/0x1d0 [] kernel_init+0x10/0xec [] ret_from_fork+0x14/0x2c -> #0 (cma_mutex){+.+.+.}: [] print_circular_bug+0x70/0x2f0 [] __lock_acquire+0x1580/0x1ca0 [] lock_acquire+0xa0/0x130 [] mutex_lock_nested+0x5c/0x3ac [] dma_release_from_contiguous+0xb8/0xf8 [] __arm_dma_free.isra.11+0x194/0x218 [] arm_dma_free+0x1c/0x24 [] drm_gem_cma_free_object+0x68/0xb8 [] drm_gem_object_free+0x30/0x38 [] drm_gem_object_handle_unreference_unlocked+0x108/0x148 [] drm_gem_handle_delete+0xb0/0x10c [] drm_gem_dumb_destroy+0x14/0x18 [] drm_mode_destroy_dumb_ioctl+0x34/0x40 [] drm_ioctl+0x3f4/0x498 [] do_vfs_ioctl+0x84/0x664 [] SyS_ioctl+0x44/0x64 [] ret_fast_syscall+0x0/0x48 other info that might help us debug this: Chain exists of: cma_mutex --> &mm->mmap_sem --> &dev->struct_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&dev->struct_mutex); lock(&mm->mmap_sem); lock(&dev->struct_mutex); lock(cma_mutex); *** DEADLOCK *** 1 lock held by Xorg/805: #0: (&dev->struct_mutex){+.+...}, at: [] drm_gem_object_handle_unreference_unlocked+0xdc/0x148 stack backtrace: CPU: 0 PID: 805 Comm: Xorg Tainted: G W 3.14.0-rc2+ #517 Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r6:c0a869f0 r5:c0a8d540 r4:00000000 r3:00000000 [] (show_stack) from [] (dump_stack+0x70/0x8c) [] (dump_stack) from [] (print_circular_bug+0x29c/0x2f0) r4:c0a79570 r3:e9338980 [] (print_circular_bug) from [] (__lock_acquire+0x1580/0x1ca0) r10:c0a6da70 r8:e9338dc8 r7:c10ed83c r6:00000001 r5:e9338db0 r4:e9338980 [] (__lock_acquire) from [] (lock_acquire+0xa0/0x130) r10:00000000 r9:00000002 r8:00000000 r7:00000000 r6:c099e3b0 r5:e8ca2000 r4:00000000 [] (lock_acquire) from [] (mutex_lock_nested+0x5c/0x3ac) r10:e9338980 r9:ea16d010 r8:e8ca2000 r7:00000000 r6:c0ebe304 r5:c03716f4 r4:c099e378 [] (mutex_lock_nested) from [] (dma_release_from_contiguous+0xb8/0xf8) r10:ebb00000 r9:ea16d010 r8:c0979cc8 r7:0002bb00 r6:000003fc r5:0003bb00 r4:c10f4a78 [] (dma_release_from_contiguous) from [] (__arm_dma_free.isra.11+0x194/0x218) r6:003fc000 r5:ea7d8000 r4:ead4e000 r3:c001db4c [] (__arm_dma_free.isra.11) from [] (arm_dma_free+0x1c/0x24) r10:e9902e20 r9:e8ca3e38 r8:e989e000 r7:e9902e58 r6:e9902f10 r5:e989e030 r4:e9aad540 [] (arm_dma_free) from [] (drm_gem_cma_free_object+0x68/0xb8) [] (drm_gem_cma_free_object) from [] (drm_gem_object_free+0x30/0x38) r4:e9aad540 [] (drm_gem_object_free) from [] (drm_gem_object_handle_unreference_unlocked+0x108/0x148) [] (drm_gem_object_handle_unreference_unlocked) from [] (drm_gem_handle_delete+0xb0/0x10c) r5:e9aad540 r4:e9902e00 [] (drm_gem_handle_delete) from [] (drm_gem_dumb_destroy+0x14/0x18) r10:c06e3448 r8:e8ca3e38 r7:e8ca2000 r6:e9902e00 r5:000000b4 r4:e8ca3e38 [] (drm_gem_dumb_destroy) from [] (drm_mode_destroy_dumb_ioctl+0x34/0x40) [] (drm_mode_destroy_dumb_ioctl) from [] (drm_ioctl+0x3f4/0x498) r4:e989e000 r3:c035e804 [] (drm_ioctl) from [] (do_vfs_ioctl+0x84/0x664) r10:00000000 r9:e8ca2000 r8:beeb6bb4 r7:e9824560 r6:c01165d0 r5:00000006 r4:e9b97300 [] (do_vfs_ioctl) from [] (SyS_ioctl+0x44/0x64) r10:00000000 r9:e8ca2000 r8:00000006 r7:c00464b4 r6:beeb6bb4 r5:e9b97300 r4:00000000 [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x48) r8:c000e8a4 r7:00000036 r6:00000006 r5:c00464b4 r4:beeb6bb4 -- FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up. Estimation in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad. Estimate before purchase was "up to 13.2Mbit". -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/