All of lore.kernel.org
 help / color / mirror / Atom feed
From: Devin Heitmueller <dheitmueller@kernellabs.com>
To: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
	Mauro Carvalho Chehab <m.chehab@samsung.com>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	laurent pinchart <laurent.pinchart@ideasonboard.com>,
	ttmesterr <ttmesterr@gmail.com>,
	linux-media <linux-media@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] media: au0828 - convert to use videobuf2
Date: Thu, 22 Jan 2015 10:00:16 -0500	[thread overview]
Message-ID: <CAGoCfiw4Sehjk0_7KWo3tQZabn1w8nVM+8WTgY2sSkL0FSZWOQ@mail.gmail.com> (raw)
In-Reply-To: <CA+V-a8uzfcyhO0vA2Jxg8YJYrHtk_b0skhN4kGCwO81X9yF--w@mail.gmail.com>

>> -       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*.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

  reply	other threads:[~2015-01-22 15:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  2:56 [PATCH v3 0/3] au0828 vb2 conversion Shuah Khan
2015-01-13  2:56 ` [PATCH v3 1/3] media: fix au0828 compile error from au0828_boards initialization Shuah Khan
2015-01-22 12:44   ` Lad, Prabhakar
2015-01-13  2:56 ` [PATCH v3 2/3] media: au0828 - convert to use videobuf2 Shuah Khan
2015-01-22 12:41   ` Lad, Prabhakar
2015-01-22 15:00     ` Devin Heitmueller [this message]
2015-01-22 15:05       ` Shuah Khan
2015-01-22 16:16     ` Shuah Khan
2015-01-22 20:47       ` Lad, Prabhakar
2015-01-22 22:27         ` Shuah Khan
2015-01-13  2:56 ` [PATCH v3 3/3] media: au0828 remove video and vbi buffer timeout work-around Shuah Khan
2015-01-13  4:44   ` Devin Heitmueller
2015-01-13 14:12     ` Shuah Khan
2015-01-13 14:19       ` Devin Heitmueller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGoCfiw4Sehjk0_7KWo3tQZabn1w8nVM+8WTgY2sSkL0FSZWOQ@mail.gmail.com \
    --to=dheitmueller@kernellabs.com \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=ttmesterr@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.