Bug 10838 - SAA7134: lock order inversion between mmap and vb locks
Summary: SAA7134: lock order inversion between mmap and vb locks
Status: RESOLVED OBSOLETE
Alias: None
Product: v4l-dvb
Classification: Unclassified
Component: saa7134 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: v4l-dvb_saa7134@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-30 11:51 UTC by Stas Sergeev
Modified: 2013-12-19 15:07 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.32-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Stas Sergeev 2008-05-30 11:51:26 UTC
Latest working kernel version:
dont know

Earliest failing kernel version:
not sure, but seems rather recent

Distribution:
F9

Hardware Environment:
x86_64 PC

Software Environment:
xawtv and saa7134 driver

Problem Description:
May 30 18:44:49 lin2 kernel: =======================================================
May 30 18:44:49 lin2 kernel: [ INFO: possible circular locking dependency detected ]
May 30 18:44:49 lin2 kernel: 2.6.26-rc3-08493-gb8291ad-dirty #18
May 30 18:44:49 lin2 kernel: -------------------------------------------------------
May 30 18:44:49 lin2 kernel: xawtv/3063 is trying to acquire lock:
May 30 18:44:49 lin2 kernel: (&mm->mmap_sem){----}, at: [<ffffffffa00d7d28>] videobuf_dma_init_user+0x48/0xa0 [videobuf_dma_sg]
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: but task is already holding lock:
May 30 18:44:49 lin2 kernel: (&q->vb_lock){--..}, at: [<ffffffffa00c8f16>] videobuf_read_one+0x46/0x458 [videobuf_core]
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: which lock already depends on the new lock.
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: the existing dependency chain (in reverse order) is:
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: -> #1 (&q->vb_lock){--..}:
May 30 18:44:49 lin2 kernel: [<ffffffff8025e5b5>] add_lock_to_list+0x65/0xe0
May 30 18:44:49 lin2 kernel: [<ffffffff80260c70>] __lock_acquire+0xbc0/0x10a0
May 30 18:44:49 lin2 kernel: [<ffffffffa01190b0>] saa7134_querybuf+0x0/0x40 [saa7134]
May 30 18:44:49 lin2 kernel: [<ffffffffa00eff3b>] __video_do_ioctl+0x1e0b/0x2ff0 [videodev]
May 30 18:44:49 lin2 kernel: [<ffffffffa00c7404>] videobuf_mmap_mapper+0x24/0x70 [videobuf_core]
May 30 18:44:49 lin2 kernel: [<ffffffff802611a7>] lock_acquire+0x57/0x80
May 30 18:44:49 lin2 kernel: [<ffffffffa00c7404>] videobuf_mmap_mapper+0x24/0x70 [videobuf_core]
May 30 18:44:49 lin2 kernel: [<ffffffff8050ce4a>] mutex_lock_nested+0xaa/0x310
May 30 18:44:49 lin2 kernel: [<ffffffff8025f7db>] mark_held_locks+0x5b/0xa0
May 30 18:44:49 lin2 kernel: [<ffffffff8025f9d7>] trace_hardirqs_on+0x117/0x160
May 30 18:44:49 lin2 kernel: [<ffffffffa00c7404>] videobuf_mmap_mapper+0x24/0x70 [videobuf_core]
May 30 18:44:49 lin2 kernel: [<ffffffff8029c25c>] mmap_region+0x21c/0x580
May 30 18:44:49 lin2 kernel: [<ffffffff8029c8a4>] do_mmap_pgoff+0x2e4/0x3f0
May 30 18:44:49 lin2 kernel: [<ffffffff8050eaaf>] _spin_unlock_irq+0x2f/0x50
May 30 18:44:49 lin2 kernel: [<ffffffff802109f5>] sys_mmap+0x115/0x140
May 30 18:44:49 lin2 kernel: [<ffffffff8020b7fb>] system_call_after_swapgs+0x7b/0x80
May 30 18:44:49 lin2 kernel: [<ffffffffffffffff>] 0xffffffffffffffff
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: -> #0 (&mm->mmap_sem){----}:
May 30 18:44:49 lin2 kernel: [<ffffffff8025fc94>] print_circular_bug_header+0xe4/0xf0
May 30 18:44:49 lin2 kernel: [<ffffffff80260d08>] __lock_acquire+0xc58/0x10a0
May 30 18:44:49 lin2 kernel: [<ffffffff8050eb35>] _spin_unlock_irqrestore+0x65/0x80
May 30 18:44:49 lin2 kernel: [<ffffffff8025f9d7>] trace_hardirqs_on+0x117/0x160
May 30 18:44:49 lin2 kernel: [<ffffffff802611a7>] lock_acquire+0x57/0x80
May 30 18:44:49 lin2 kernel: [<ffffffffa00d7d28>] videobuf_dma_init_user+0x48/0xa0 [videobuf_dma_sg]
May 30 18:44:49 lin2 kernel: [<ffffffff8050d7d2>] down_read+0x32/0x40
May 30 18:44:49 lin2 kernel: [<ffffffffa00d7d28>] videobuf_dma_init_user+0x48/0xa0 [videobuf_dma_sg]
May 30 18:44:49 lin2 kernel: [<ffffffffa00d8208>] __videobuf_iolock+0xe8/0x140 [videobuf_dma_sg]
May 30 18:44:49 lin2 kernel: [<ffffffffa0117534>] buffer_prepare+0x1d4/0x220 [saa7134]
May 30 18:44:49 lin2 kernel: [<ffffffff8036f806>] __spin_lock_init+0x36/0x70
May 30 18:44:49 lin2 kernel: [<ffffffffa00c91dd>] videobuf_read_one+0x30d/0x458 [videobuf_core]
May 30 18:44:49 lin2 kernel: [<ffffffff8050f116>] unlock_kernel+0x36/0x60
May 30 18:44:49 lin2 kernel: [<ffffffff802b3a58>] vfs_read+0xc8/0x170
May 30 18:44:49 lin2 kernel: [<ffffffff802b3c03>] sys_read+0x53/0xa0
May 30 18:44:49 lin2 kernel: [<ffffffff8020b7fb>] system_call_after_swapgs+0x7b/0x80
May 30 18:44:49 lin2 kernel: [<ffffffffffffffff>] 0xffffffffffffffff
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: other info that might help us debug this:
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: 1 lock held by xawtv/3063:
May 30 18:44:49 lin2 kernel: #0:  (&q->vb_lock){--..}, at: [<ffffffffa00c8f16>] videobuf_read_one+0x46/0x458 [videobuf_core]
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: stack backtrace:
May 30 18:44:49 lin2 kernel: Pid: 3063, comm: xawtv Not tainted 2.6.26-rc3-08493-gb8291ad-dirty #18
May 30 18:44:49 lin2 kernel: 
May 30 18:44:49 lin2 kernel: Call Trace:
May 30 18:44:49 lin2 kernel: [<ffffffff8025fde9>] print_circular_bug_tail+0x89/0x90
May 30 18:44:49 lin2 kernel: [<ffffffff8025fc94>] print_circular_bug_header+0xe4/0xf0
May 30 18:44:49 lin2 kernel: [<ffffffff80260d08>] __lock_acquire+0xc58/0x10a0
May 30 18:44:49 lin2 kernel: [<ffffffff8050eb35>] _spin_unlock_irqrestore+0x65/0x80
May 30 18:44:49 lin2 kernel: [<ffffffff8025f9d7>] trace_hardirqs_on+0x117/0x160
May 30 18:44:49 lin2 kernel: [<ffffffff802611a7>] lock_acquire+0x57/0x80
May 30 18:44:49 lin2 kernel: [<ffffffffa00d7d28>] :videobuf_dma_sg:videobuf_dma_init_user+0x48/0xa0
May 30 18:44:49 lin2 kernel: [<ffffffff8050d7d2>] down_read+0x32/0x40
May 30 18:44:49 lin2 kernel: [<ffffffffa00d7d28>] :videobuf_dma_sg:videobuf_dma_init_user+0x48/0xa0
May 30 18:44:49 lin2 kernel: [<ffffffffa00d8208>] :videobuf_dma_sg:__videobuf_iolock+0xe8/0x140
May 30 18:44:49 lin2 kernel: [<ffffffffa0117534>] :saa7134:buffer_prepare+0x1d4/0x220
May 30 18:44:49 lin2 kernel: [<ffffffff8036f806>] __spin_lock_init+0x36/0x70
May 30 18:44:49 lin2 kernel: [<ffffffffa00c91dd>] :videobuf_core:videobuf_read_one+0x30d/0x458
May 30 18:44:49 lin2 kernel: [<ffffffff8050f116>] unlock_kernel+0x36/0x60
May 30 18:44:49 lin2 kernel: [<ffffffff802b3a58>] vfs_read+0xc8/0x170
May 30 18:44:49 lin2 kernel: [<ffffffff802b3c03>] sys_read+0x53/0xa0
May 30 18:44:49 lin2 kernel: [<ffffffff8020b7fb>] system_call_after_swapgs+0x7b/0x80
Comment 1 Stas Sergeev 2008-05-30 11:52:19 UTC
lspci
00:00.0 Memory controller: nVidia Corporation CK804 Memory Controller (rev a3)
00:01.0 ISA bridge: nVidia Corporation CK804 ISA Bridge (rev a3)
00:01.1 SMBus: nVidia Corporation CK804 SMBus (rev a2)
00:02.0 USB Controller: nVidia Corporation CK804 USB Controller (rev a2)
00:02.1 USB Controller: nVidia Corporation CK804 USB Controller (rev a3)
00:04.0 Multimedia audio controller: nVidia Corporation CK804 AC'97 Audio Controller (rev a2)
00:06.0 IDE interface: nVidia Corporation CK804 IDE (rev f2)
00:07.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev f3)
00:08.0 IDE interface: nVidia Corporation CK804 Serial ATA Controller (rev f3)
00:09.0 PCI bridge: nVidia Corporation CK804 PCI Bridge (rev a2)
00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)
00:0b.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0c.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0d.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:0e.0 PCI bridge: nVidia Corporation CK804 PCIE Bridge (rev a3)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8185 IEEE 802.11a/b/g Wireless LAN Controller (rev 20)
01:08.0 Multimedia controller: Philips Semiconductors SAA7134/SAA7135HL Video Broadcast Decoder (rev 01)
05:00.0 VGA compatible controller: ATI Technologies Inc Radeon HD 3870
05:00.1 Audio device: ATI Technologies Inc Radeon HD 3870 Audio device
Comment 2 Stas Sergeev 2009-10-27 07:14:13 UTC
Still present on 2.6.32-rc4-git

Note You need to log in before you can comment on or make changes to this bug.