Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-08-17 Thread Zahari Doychev
On Fri, Aug 14, 2015 at 01:57:51PM +0200, Hans Verkuil wrote: > On 08/12/2015 05:50 PM, Kamil Debski wrote: > > Hi, > > > > On 12 August 2015 at 13:42, Marek Szyprowski > > wrote: > >> Hello Hans, > >> > >> I'm sorry for a delay. Once again I've been busy with some other internal > >> stuff. > >

Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-08-14 Thread Hans Verkuil
On 08/12/2015 05:50 PM, Kamil Debski wrote: > Hi, > > On 12 August 2015 at 13:42, Marek Szyprowski wrote: >> Hello Hans, >> >> I'm sorry for a delay. Once again I've been busy with some other internal >> stuff. >> >> On 2015-07-28 11:02, Hans Verkuil wrote: >>> >>> Kamil, Marek, >>> >>> Why does

Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-08-12 Thread Kamil Debski
Hi, On 12 August 2015 at 13:42, Marek Szyprowski wrote: > Hello Hans, > > I'm sorry for a delay. Once again I've been busy with some other internal > stuff. > > On 2015-07-28 11:02, Hans Verkuil wrote: >> >> Kamil, Marek, >> >> Why does v4l2_m2m_poll unlock and lock in that function? > > > I've c

Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-08-12 Thread Marek Szyprowski
Hello Hans, I'm sorry for a delay. Once again I've been busy with some other internal stuff. On 2015-07-28 11:02, Hans Verkuil wrote: Kamil, Marek, Why does v4l2_m2m_poll unlock and lock in that function? I've checked the code and indeed the poll_wait() function doesn't do anything that s

Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-07-28 Thread Hans Verkuil
(sent again, this time with Kamil's new email) Kamil, Marek, Why does v4l2_m2m_poll unlock and lock in that function? Zahari is right that the locking is unbalanced, but I don't see the reason for the unlock/lock sequence in the first place. I'm wondering if that shouldn't just be removed. Am I

Re: [PATCH 2/2] [media] m2m: fix bad unlock balance

2015-07-28 Thread Hans Verkuil
Kamil, Marek, Why does v4l2_m2m_poll unlock and lock in that function? Zahari is right that the locking is unbalanced, but I don't see the reason for the unlock/lock sequence in the first place. I'm wondering if that shouldn't just be removed. Am I missing something? Instead, I would expect to

[PATCH 2/2] [media] m2m: fix bad unlock balance

2015-07-08 Thread Zahari Doychev
This commit fixes bad unlock balance when polling. v4l2_m2m_poll is called with mutex hold but the function releases the mutex and returns. This leads to the bad unlock because after the call of v4l2_m2m_poll in v4l2_m2m_fop_poll the mutex is again unlocked. This patch makes sure that the v4l2_m2m