linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* au0828_init_tuner() called without dev lock held
@ 2014-09-22 16:31 Shuah Khan
  2014-09-22 16:37 ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Shuah Khan @ 2014-09-22 16:31 UTC (permalink / raw)
  To: Hans Verkuil, mauro Carvalho Chehab (m.chehab@samsung.com),
	Linux Media Mailing List, Shuah Khan

Hi Hans and Mauro,

While I was making changes for media token work, I noticed there are
several places au0828_init_tuner() gets called without holding dev lock.

vidioc_s_std(), vidioc_g_tuner(), vidioc_s_tuner(), vidioc_streamon()
au0828_v4l2_resume()

Some of these might be intended since au0828_init_tuner() invokes
s_std. All of these changes including the au0828_init_tuner() itself
were added in ea86968fb91471493ccac7d8f2a65bc65db6803b

au0828_v4l2_resume() also does this and this one for sure needs fixing
very likely. I am not sure about the others. Thoughts??

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: au0828_init_tuner() called without dev lock held
  2014-09-22 16:31 au0828_init_tuner() called without dev lock held Shuah Khan
@ 2014-09-22 16:37 ` Hans Verkuil
  2014-09-22 16:40   ` Shuah Khan
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2014-09-22 16:37 UTC (permalink / raw)
  To: Shuah Khan, mauro Carvalho Chehab (m.chehab@samsung.com),
	Linux Media Mailing List

On 09/22/2014 06:31 PM, Shuah Khan wrote:
> Hi Hans and Mauro,
> 
> While I was making changes for media token work, I noticed there are
> several places au0828_init_tuner() gets called without holding dev lock.

au0828 sets the lock pointer in struct video_device to the dev lock.
That means that all v4l2 ioctl calls are serialized in v4l2_ioctl()
in v4l2-dev.c. So these calls *do* hold the device lock.

Not au0828_v4l2_resume() though, that's not an ioctl op.

Regards,

	Hans

> 
> vidioc_s_std(), vidioc_g_tuner(), vidioc_s_tuner(), vidioc_streamon()
> au0828_v4l2_resume()
> 
> Some of these might be intended since au0828_init_tuner() invokes
> s_std. All of these changes including the au0828_init_tuner() itself
> were added in ea86968fb91471493ccac7d8f2a65bc65db6803b
> 
> au0828_v4l2_resume() also does this and this one for sure needs fixing
> very likely. I am not sure about the others. Thoughts??
> 
> -- Shuah
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: au0828_init_tuner() called without dev lock held
  2014-09-22 16:37 ` Hans Verkuil
@ 2014-09-22 16:40   ` Shuah Khan
  0 siblings, 0 replies; 3+ messages in thread
From: Shuah Khan @ 2014-09-22 16:40 UTC (permalink / raw)
  To: Hans Verkuil, mauro Carvalho Chehab (m.chehab@samsung.com),
	Linux Media Mailing List

On 09/22/2014 10:37 AM, Hans Verkuil wrote:
> On 09/22/2014 06:31 PM, Shuah Khan wrote:
>> Hi Hans and Mauro,
>>
>> While I was making changes for media token work, I noticed there are
>> several places au0828_init_tuner() gets called without holding dev lock.
> 
> au0828 sets the lock pointer in struct video_device to the dev lock.
> That means that all v4l2 ioctl calls are serialized in v4l2_ioctl()
> in v4l2-dev.c. So these calls *do* hold the device lock.
> 
> Not au0828_v4l2_resume() though, that's not an ioctl op.
> 

Good. I will go ahead and fix au0828_v4l2_resume() to do
it right.

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-22 16:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-22 16:31 au0828_init_tuner() called without dev lock held Shuah Khan
2014-09-22 16:37 ` Hans Verkuil
2014-09-22 16:40   ` Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).