lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Jan 2015 08:05:18 -0700
From:	Shuah Khan <shuahkh@....samsung.com>
To:	Devin Heitmueller <dheitmueller@...nellabs.com>,
	"Lad, Prabhakar" <prabhakar.csengg@...il.com>
CC:	Mauro Carvalho Chehab <m.chehab@...sung.com>,
	Hans Verkuil <hans.verkuil@...co.com>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	laurent pinchart <laurent.pinchart@...asonboard.com>,
	ttmesterr <ttmesterr@...il.com>,
	linux-media <linux-media@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/3] media: au0828 - convert to use videobuf2

On 01/22/2015 08:00 AM, Devin Heitmueller wrote:
>>> -       fh->type = type;
>>> -       fh->dev = dev;
>>> -       v4l2_fh_init(&fh->fh, vdev);
>>> -       filp->private_data = fh;
>>> +       dprintk(1,
>>> +               "%s called std_set %d dev_state %d stream users %d users %d\n",
>>> +               __func__, dev->std_set_in_tuner_core, dev->dev_state,
>>> +               dev->streaming_users, dev->users);
>>>
>>> -       if (mutex_lock_interruptible(&dev->lock)) {
>>> -               kfree(fh);
>>> +       if (mutex_lock_interruptible(&dev->lock))
>>>                 return -ERESTARTSYS;
>>> +
>>> +       ret = v4l2_fh_open(filp);
>>> +       if (ret) {
>>> +               au0828_isocdbg("%s: v4l2_fh_open() returned error %d\n",
>>> +                               __func__, ret);
>>> +               mutex_unlock(&dev->lock);
>>> +               return ret;
>>>         }
>>> +
>>>         if (dev->users == 0) {
>>
>> you can use v4l2_fh_is_singular_file() and get rid of users member ?
> 
> That won't work because the underlying resources are shared between
> /dev/videoX and /dev/vbiX device nodes.  Hence if you were to move to
> v4l2_fh_is_singular_file(), the video device would get opened, the
> stream would get reset, the VBI device would get opened, and that
> would cause the analog stream to get enabled/reset *again*.
> 

Thanks Devin for a detailed explanation. I did see this behavior when I
was removed users and used v4l2_fh_is_singular_file() instead. I didn't
understand that this is due to resource sharing between /dev/videoX and
/dev/vbiX .

thanks,
-- Shuah


-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@....samsung.com | (970) 217-8978
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ