linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuahkh@osg.samsung.com>
To: Hans Verkuil <hverkuil@xs4all.nl>,
	m.chehab@samsung.com, akpm@linux-foundation.org,
	gregkh@linuxfoundation.org, crope@iki.fi, olebowle@gmx.com,
	dheitmueller@kernellabs.co, ramakrmu@cisco.com,
	sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com
Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	Shuah Khan <shuahkh@osg.samsung.com>
Subject: Re: [PATCH 1/5] media: add media token device resource framework
Date: Wed, 24 Sep 2014 07:56:37 -0600	[thread overview]
Message-ID: <5422CD95.7010905@osg.samsung.com> (raw)
In-Reply-To: <5422AA63.1070406@xs4all.nl>

On 09/24/2014 05:26 AM, Hans Verkuil wrote:
> Hi Shuah,
> 
> Here is my review...
> 
> On 09/22/2014 05:00 PM, Shuah Khan wrote:
>> Add media token device resource framework to allow sharing
>> resources such as tuner, dma, audio etc. across media drivers
>> and non-media sound drivers that control media hardware. The
>> Media token resource is created at the main struct device that
>> is common to all drivers that claim various pieces of the main
>> media device, which allows them to find the resource using the
>> main struct device. As an example, digital, analog, and
>> snd-usb-audio drivers can use the media token resource API
>> using the main struct device for the interface the media device
>> is attached to.
>>
>> The media token resource contains token for tuner, dma, and
>> audio.
> 
> Why dma and audio? Neither is being used in this patch series. I
> would leave them out until you actually show how they are used in a
> driver.

Yeah I can remove these. I am not using them in this series.

>> +static int __media_get_tkn(struct media_tkn *tkn,
>> +                enum media_tkn_mode mode, bool exclusive)
>> +{
>> +    int rc = 0;
>> +
>> +    spin_lock(&tkn->lock);
>> +    if (tkn->is_exclusive)
>> +        rc = -EBUSY;
>> +    else if (tkn->owners && ((mode != tkn->mode) || exclusive))
>> +        rc = -EBUSY;
>> +    else {
>> +        if (tkn->owners < INT_MAX)
>> +            tkn->owners++;
>> +        else
>> +            tkn->owners = 1;
> 
> Somewhat weird. Can owners ever become INT_MAX?
> 

I didn't have this at first. I was testing with tvtime and
noticed the count going up to 40k+ while it is streaming.
The count kept going up. So I figured I might as well add
the check to cover for cases where application like tvtime
run for a very longtime like a couple of hours.

thanks,
-- Shuah


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

  reply	other threads:[~2014-09-24 13:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 15:00 [PATCH 0/5] media token resource framework Shuah Khan
2014-09-22 15:00 ` [PATCH 1/5] media: add media token device " Shuah Khan
2014-09-24 11:26   ` Hans Verkuil
2014-09-24 13:56     ` Shuah Khan [this message]
2014-09-22 15:00 ` [PATCH 2/5] media: v4l2-core changes to use media tuner token api Shuah Khan
     [not found]   ` <CAGoCfizUWx-RrRbtuv7ctTqZskmDPK-w9bRTnEwjwn6oJ=V48g@mail.gmail.com>
2014-09-22 20:43     ` Shuah Khan
2014-09-23 14:17       ` Devin Heitmueller
2014-09-23 20:46         ` Shuah Khan
2014-09-24 12:25           ` Hans Verkuil
2014-09-24 15:57             ` Shuah Khan
2014-09-25  7:15               ` Hans Verkuil
2014-10-06 12:29             ` Laurent Pinchart
2014-09-24 11:57   ` Hans Verkuil
2014-09-24 14:24     ` Shuah Khan
2014-09-24 15:30     ` Shuah Khan
2014-09-22 15:00 ` [PATCH 3/5] media: au0828-video " Shuah Khan
2014-09-22 15:00 ` [PATCH 4/5] media: dvb-core " Shuah Khan
2014-09-22 15:00 ` [PATCH 5/5] media: au0828-core changes to create and destroy media token res Shuah Khan

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=5422CD95.7010905@osg.samsung.com \
    --to=shuahkh@osg.samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=crope@iki.fi \
    --cc=dheitmueller@kernellabs.co \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=olebowle@gmx.com \
    --cc=ramakrmu@cisco.com \
    --cc=sakari.ailus@linux.intel.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 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).