From: Marcin Slusarz Subject: nouveau: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected Date: Sun, 16 Jan 2011 00:23:26 +0100 Message-ID: <20110115232326.GB2980@joi.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Errors-To: nouveau-bounces+gcfxn-nouveau=m.gmane.org-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org On 2.6.37 kernel during X reloading: [ 718.868720] [drm] nouveau 0000:02:00.0: nouveau_channel_free: freeing fifo 2 [ 718.883387] [ 718.883388] ====================================================== [ 718.883392] [ INFO: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected ] [ 718.883396] 2.6.37+ #521 [ 718.883398] ------------------------------------------------------ [ 718.883402] X/2431 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: [ 718.883405] (&(&dev_priv->ramin_lock)->rlock){+.+...}, at: [] nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.883425] [ 718.883425] and this task is already holding: [ 718.883428] (&(&dev_priv->context_switch_lock)->rlock){-.....}, at: [] nouveau_channel_free+0x10f/0x249 [nouveau] [ 718.883443] which would create a new lock dependency: [ 718.883446] (&(&dev_priv->context_switch_lock)->rlock){-.....} -> (&(&dev_priv->ramin_lock)->rlock){+.+...} [ 718.883455] [ 718.883455] but this new dependency connects a HARDIRQ-irq-safe lock: [ 718.883458] (&(&dev_priv->context_switch_lock)->rlock){-.....} [ 718.883462] ... which became HARDIRQ-irq-safe at: [ 718.883465] [] __lock_acquire+0x62d/0x1602 [ 718.883471] [] lock_acquire+0x144/0x189 [ 718.883476] [] _raw_spin_lock_irqsave+0x41/0x53 [ 718.883483] [] nouveau_irq_handler+0x60/0xcc9 [nouveau] [ 718.883495] [] handle_IRQ_event+0xf1/0x262 [ 718.883502] [] handle_fasteoi_irq+0xaa/0xed [ 718.883507] [] handle_irq+0x83/0x8c [ 718.883513] [] do_IRQ+0x5e/0xc4 [ 718.883517] [] ret_from_intr+0x0/0xf [ 718.883523] [] cpu_idle+0x7b/0x18e [ 718.883529] [] start_secondary+0x1ba/0x1bf [ 718.883536] [ 718.883536] to a HARDIRQ-irq-unsafe lock: [ 718.883539] (&(&dev_priv->ramin_lock)->rlock){+.+...} [ 718.883545] ... [] __lock_acquire+0x6a6/0x1602 [ 718.883551] [] lock_acquire+0x144/0x189 [ 718.883556] [] _raw_spin_lock+0x36/0x45 [ 718.883561] [] nouveau_gpuobj_new+0x219/0x4de [nouveau] [ 718.883574] [] nv50_instmem_init+0x2f3/0x92d [nouveau] [ 718.883592] [] nouveau_card_init+0x104d/0x135f [nouveau] [ 718.883603] [] nouveau_load+0x6f8/0x77d [nouveau] [ 718.883614] [] drm_get_pci_dev+0x239/0x35a [ 718.883619] [] nouveau_pci_probe+0x10/0x17 [nouveau] [ 718.883636] [] local_pci_probe+0x12/0x16 [ 718.883642] [] pci_device_probe+0x60/0x8f [ 718.883647] [] driver_probe_device+0xa7/0x136 [ 718.883652] [] __driver_attach+0x5c/0x80 [ 718.883658] [] bus_for_each_dev+0x54/0x89 [ 718.883663] [] driver_attach+0x19/0x1b [ 718.883668] [] bus_add_driver+0x194/0x2fd [ 718.883673] [] driver_register+0x99/0x10a [ 718.883678] [] __pci_register_driver+0x63/0xd3 [ 718.883683] [] drm_pci_init+0x2f/0x95 [ 718.883688] [] drm_init+0x5d/0x61 [ 718.883693] [] 0xffffffffa011b048 [ 718.883698] [] do_one_initcall+0x7a/0x12e [ 718.883704] [] sys_init_module+0x9c/0x1dc [ 718.883710] [] system_call_fastpath+0x16/0x1b [ 718.883716] [ 718.883716] other info that might help us debug this: [ 718.883717] [ 718.883721] 2 locks held by X/2431: [ 718.883723] #0: (drm_global_mutex){+.+.+.}, at: [] drm_ioctl+0x28a/0x343 [ 718.883748] [ 718.883764] -> (&(&dev_priv->context_switch_lock)->rlock){-.....} ops: 10 { [ 718.883772] IN-HARDIRQ-W at: [ 718.883776] [] __lock_acquire+0x62d/0x1602 [ 718.883782] [] lock_acquire+0x144/0x189 [ 718.883787] [] _raw_spin_lock_irqsave+0x41/0x53 [ 718.883793] [] nouveau_irq_handler+0x60/0xcc9 [nouveau] [ 718.883807] [] handle_IRQ_event+0xf1/0x262 [ 718.883813] [] handle_fasteoi_irq+0xaa/0xed [ 718.883819] [] handle_irq+0x83/0x8c [ 718.883825] [] do_IRQ+0x5e/0xc4 [ 718.883830] [] ret_from_intr+0x0/0xf [ 718.883836] [] cpu_idle+0x7b/0x18e [ 718.883842] [] start_secondary+0x1ba/0x1bf [ 718.883849] INITIAL USE at: [ 718.883852] [] __lock_acquire+0x721/0x1602 [ 718.883858] [] lock_acquire+0x144/0x189 [ 718.883864] [] _raw_spin_lock_irqsave+0x41/0x53 [ 718.883870] [] nv50_fifo_create_context+0x12c/0x2c9 [nouveau] [ 718.883889] [] nouveau_channel_alloc+0x538/0x5fa [nouveau] [ 718.883901] [] nouveau_card_init+0x117d/0x135f [nouveau] [ 718.883913] [] nouveau_load+0x6f8/0x77d [nouveau] [ 718.883924] [] drm_get_pci_dev+0x239/0x35a [ 718.883930] [] nouveau_pci_probe+0x10/0x17 [nouveau] [ 718.883948] [] local_pci_probe+0x12/0x16 [ 718.883953] [] pci_device_probe+0x60/0x8f [ 718.883959] [] driver_probe_device+0xa7/0x136 [ 718.883965] [] __driver_attach+0x5c/0x80 [ 718.883971] [] bus_for_each_dev+0x54/0x89 [ 718.883977] [] driver_attach+0x19/0x1b [ 718.883983] [] bus_add_driver+0x194/0x2fd [ 718.883989] [] driver_register+0x99/0x10a [ 718.883995] [] __pci_register_driver+0x63/0xd3 [ 718.884001] [] drm_pci_init+0x2f/0x95 [ 718.884006] [] drm_init+0x5d/0x61 [ 718.884012] [] 0xffffffffa011b048 [ 718.884017] [] do_one_initcall+0x7a/0x12e [ 718.884024] [] sys_init_module+0x9c/0x1dc [ 718.884030] [] system_call_fastpath+0x16/0x1b [ 718.884036] } [ 718.884052] ... acquired at: [ 718.884073] [] nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884085] [] kref_put+0x43/0x4d [ 718.884092] [] nouveau_gpuobj_ref+0x34/0x3d [nouveau] [ 718.884104] [] nv50_graph_destroy_context+0xb7/0xc3 [nouveau] [ 718.884122] [] nouveau_channel_free+0x145/0x249 [nouveau] [ 718.884133] [] nouveau_ioctl_fifo_free+0x6f/0x73 [nouveau] [ 718.884144] [] drm_ioctl+0x299/0x343 [ 718.884149] [] do_vfs_ioctl+0x499/0x4e8 [ 718.884155] [] sys_ioctl+0x42/0x65 [ 718.884159] [] system_call_fastpath+0x16/0x1b [ 718.884165] [ 718.884167] [ 718.884168] the dependencies between the lock to be acquired and HARDIRQ-irq-unsafe lock: [ 718.884183] -> (&(&dev_priv->ramin_lock)->rlock){+.+...} ops: 20683 { [ 718.884190] HARDIRQ-ON-W at: [ 718.884194] [] __lock_acquire+0x6a6/0x1602 [ 718.884200] [] lock_acquire+0x144/0x189 [ 718.884205] [] _raw_spin_lock+0x36/0x45 [ 718.884211] [] nouveau_gpuobj_new+0x219/0x4de [nouveau] [ 718.884224] [] nv50_instmem_init+0x2f3/0x92d [nouveau] [ 718.884243] [] nouveau_card_init+0x104d/0x135f [nouveau] [ 718.884255] [] nouveau_load+0x6f8/0x77d [nouveau] [ 718.884266] [] drm_get_pci_dev+0x239/0x35a [ 718.884272] [] nouveau_pci_probe+0x10/0x17 [nouveau] [ 718.884290] [] local_pci_probe+0x12/0x16 [ 718.884295] [] pci_device_probe+0x60/0x8f [ 718.884301] [] driver_probe_device+0xa7/0x136 [ 718.884307] [] __driver_attach+0x5c/0x80 [ 718.884313] [] bus_for_each_dev+0x54/0x89 [ 718.884319] [] driver_attach+0x19/0x1b [ 718.884325] [] bus_add_driver+0x194/0x2fd [ 718.884331] [] driver_register+0x99/0x10a [ 718.884337] [] __pci_register_driver+0x63/0xd3 [ 718.884343] [] drm_pci_init+0x2f/0x95 [ 718.884348] [] drm_init+0x5d/0x61 [ 718.884354] [] 0xffffffffa011b048 [ 718.884359] [] do_one_initcall+0x7a/0x12e [ 718.884365] [] sys_init_module+0x9c/0x1dc [ 718.884372] [] system_call_fastpath+0x16/0x1b [ 718.884378] SOFTIRQ-ON-W at: [ 718.884382] [] __lock_acquire+0x6c9/0x1602 [ 718.884387] [] lock_acquire+0x144/0x189 [ 718.884393] [] _raw_spin_lock+0x36/0x45 [ 718.884399] [] nouveau_gpuobj_new+0x219/0x4de [nouveau] [ 718.884430] [] nouveau_card_init+0x104d/0x135f [nouveau] [ 718.884442] [] nouveau_load+0x6f8/0x77d [nouveau] [ 718.884454] [] drm_get_pci_dev+0x239/0x35a [ 718.884460] [] nouveau_pci_probe+0x10/0x17 [nouveau] [ 718.884477] [] local_pci_probe+0x12/0x16 [ 718.884483] [] pci_device_probe+0x60/0x8f [ 718.884489] [] driver_probe_device+0xa7/0x136 [ 718.884495] [] __driver_attach+0x5c/0x80 [ 718.884501] [] bus_for_each_dev+0x54/0x89 [ 718.884507] [] driver_attach+0x19/0x1b [ 718.884513] [] bus_add_driver+0x194/0x2fd [ 718.884518] [] driver_register+0x99/0x10a [ 718.884524] [] __pci_register_driver+0x63/0xd3 [ 718.884530] [] drm_pci_init+0x2f/0x95 [ 718.884536] [] drm_init+0x5d/0x61 [ 718.884541] [] 0xffffffffa011b048 [ 718.884546] [] do_one_initcall+0x7a/0x12e [ 718.884553] [] sys_init_module+0x9c/0x1dc [ 718.884559] [] system_call_fastpath+0x16/0x1b [ 718.884565] INITIAL USE at: [ 718.884569] [] __lock_acquire+0x721/0x1602 [ 718.884575] [] lock_acquire+0x144/0x189 [ 718.884580] [] _raw_spin_lock+0x36/0x45 [ 718.884586] [] nouveau_gpuobj_new+0x219/0x4de [nouveau] [ 718.884599] [] nv50_instmem_init+0x2f3/0x92d [nouveau] [ 718.884617] [] nouveau_card_init+0x104d/0x135f [nouveau] [ 718.884629] [] nouveau_load+0x6f8/0x77d [nouveau] [ 718.884641] [] drm_get_pci_dev+0x239/0x35a [ 718.884647] [] nouveau_pci_probe+0x10/0x17 [nouveau] [ 718.884664] [] local_pci_probe+0x12/0x16 [ 718.884670] [] pci_device_probe+0x60/0x8f [ 718.884676] [] driver_probe_device+0xa7/0x136 [ 718.884682] [] __driver_attach+0x5c/0x80 [ 718.884688] [] bus_for_each_dev+0x54/0x89 [ 718.884694] [] driver_attach+0x19/0x1b [ 718.884700] [] bus_add_driver+0x194/0x2fd [ 718.884706] [] driver_register+0x99/0x10a [ 718.884712] [] __pci_register_driver+0x63/0xd3 [ 718.884734] [] do_one_initcall+0x7a/0x12e [ 718.884740] [] sys_init_module+0x9c/0x1dc [ 718.884746] [] system_call_fastpath+0x16/0x1b [ 718.884752] } [ 718.884754] ... key at: [] __key.41343+0x0/0xfffffffffffed2d7 [nouveau] [ 718.884767] ... acquired at: [ 718.884770] [] check_irq_usage+0x5d/0xbe [ 718.884775] [] __lock_acquire+0xfa8/0x1602 [ 718.884779] [] lock_acquire+0x144/0x189 [ 718.884784] [] _raw_spin_lock+0x36/0x45 [ 718.884789] [] nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884801] [] kref_put+0x43/0x4d [ 718.884807] [] nouveau_gpuobj_ref+0x34/0x3d [nouveau] [ 718.884819] [] nv50_graph_destroy_context+0xb7/0xc3 [nouveau] [ 718.884836] [] nouveau_channel_free+0x145/0x249 [nouveau] [ 718.884848] [] nouveau_ioctl_fifo_free+0x6f/0x73 [nouveau] [ 718.884858] [] drm_ioctl+0x299/0x343 [ 718.884864] [] do_vfs_ioctl+0x499/0x4e8 [ 718.884868] [] sys_ioctl+0x42/0x65 [ 718.884873] [] system_call_fastpath+0x16/0x1b [ 718.884879] [ 718.884880] [ 718.884881] stack backtrace: [ 718.884885] Pid: 2431, comm: X Not tainted 2.6.37+ #521 [ 718.884888] Call Trace: [ 718.884893] [] check_usage+0x45c/0x470 [ 718.884900] [] check_irq_usage+0x5d/0xbe [ 718.884905] [] __lock_acquire+0xfa8/0x1602 [ 718.884918] [] ? nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884923] [] lock_acquire+0x144/0x189 [ 718.884934] [] ? nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884940] [] _raw_spin_lock+0x36/0x45 [ 718.884952] [] ? nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884970] [] ? nv84_instmem_flush+0x42/0x72 [nouveau] [ 718.884982] [] nouveau_gpuobj_del+0xc0/0x112 [nouveau] [ 718.884994] [] ? nouveau_gpuobj_del+0x0/0x112 [nouveau] [ 718.885000] [] kref_put+0x43/0x4d [ 718.885011] [] nouveau_gpuobj_ref+0x34/0x3d [nouveau] [ 718.885029] [] nv50_graph_destroy_context+0xb7/0xc3 [nouveau] [ 718.885040] [] nouveau_channel_free+0x145/0x249 [nouveau] [ 718.885052] [] nouveau_ioctl_fifo_free+0x6f/0x73 [nouveau] [ 718.885057] [] drm_ioctl+0x299/0x343 [ 718.885068] [] ? nouveau_ioctl_fifo_free+0x0/0x73 [nouveau] [ 718.885074] [] ? mark_held_locks+0x52/0x70 [ 718.885080] [] ? kmem_cache_free+0xb4/0x194 [ 718.885085] [] ? trace_hardirqs_on_caller+0x118/0x13c [ 718.885090] [] do_vfs_ioctl+0x499/0x4e8 [ 718.885095] [] ? fget_light+0x138/0x311 [ 718.885100] [] sys_ioctl+0x42/0x65 [ 718.885106] [] system_call_fastpath+0x16/0x1b