While testing gtk-v4l's new ctrl event code, I hit the following deadlock
in the pwc driver:
Thread 1:
significant amount of time and we don't want to block DQBUF / QBUF too long
Thread 2:
Thread 1:
unlock that
Now we have thread 1 waiting for the modlock while holding the ctrl_handler
lock and thread 2 waiting for the ctrl_handler lock while holding the
modlock -> deadlock.
1) We cannot unlock modlock from pwc_s_ctrl / pwc_g_volatile_ctrl,
but this can cause QBUF / DQBUF to block for up to a full second
2) After evaluating various option I came to the conclusion that pwc should
stop using the v4l2 core locking, and instead do its own locking
Thus this patch stops pwc using the v4l2 core locking, and replaces that with
it doing its own locking where necessary.
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>