* videobuf mmap deadlock
@ 2013-11-01 18:54 Pete Eberlein
2013-11-11 12:29 ` Hans Verkuil
0 siblings, 1 reply; 2+ messages in thread
From: Pete Eberlein @ 2013-11-01 18:54 UTC (permalink / raw)
To: linux-media; +Cc: viro, mchehab
The patch "videobuf_vm_{open,close} race fixes"
https://linuxtv.org/patch/18365/ introduced a deadlock in 3.11.
My driver uses videobuf_vmalloc initialized with ext_lock set to NULL.
My driver's mmap function calls videobuf_mmap_mapper
videobuf_mmap_mapper calls videobuf_queue_lock on q
videobuf_mmap_mapper calls __videobuf_mmap_mapper
__videobuf_mmap_mapper calls videobuf_vm_open
videobuf_vm_open calls videobuf_queue_lock on q (introduced by above patch)
deadlocked
This is not an issue if ext_lock is non-NULL, since videobuf_queue_lock
is a no-op in that case.
Did I do something wrong, or is this a valid regression?
Regards,
Pete Eberlein
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: videobuf mmap deadlock
2013-11-01 18:54 videobuf mmap deadlock Pete Eberlein
@ 2013-11-11 12:29 ` Hans Verkuil
0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2013-11-11 12:29 UTC (permalink / raw)
To: Pete Eberlein; +Cc: linux-media, viro, mchehab
Hi Pete,
On 11/01/2013 07:54 PM, Pete Eberlein wrote:
> The patch "videobuf_vm_{open,close} race fixes"
> https://linuxtv.org/patch/18365/ introduced a deadlock in 3.11.
>
> My driver uses videobuf_vmalloc initialized with ext_lock set to NULL.
Which driver are we talking about?
> My driver's mmap function calls videobuf_mmap_mapper
> videobuf_mmap_mapper calls videobuf_queue_lock on q
> videobuf_mmap_mapper calls __videobuf_mmap_mapper
> __videobuf_mmap_mapper calls videobuf_vm_open
> videobuf_vm_open calls videobuf_queue_lock on q (introduced by above patch)
> deadlocked
>
> This is not an issue if ext_lock is non-NULL, since videobuf_queue_lock
> is a no-op in that case.
>
> Did I do something wrong, or is this a valid regression?
I think this is a valid regression. Using an atomic_t for the count is a better
solution IMHO. Anyone up for writing a patch?
Locking in videobuf is very messy and I recommend moving to videobuf2 which is
much more reliable and much easier to understand as well.
Regards,
Hans
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-11 12:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01 18:54 videobuf mmap deadlock Pete Eberlein
2013-11-11 12:29 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox