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]
Message-ID: <5422CD95.7010905@osg.samsung.com>
Date:	Wed, 24 Sep 2014 07:56:37 -0600
From:	Shuah Khan <shuahkh@....samsung.com>
To:	Hans Verkuil <hverkuil@...all.nl>, m.chehab@...sung.com,
	akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
	crope@....fi, olebowle@....com, dheitmueller@...nellabs.co,
	ramakrmu@...co.com, sakari.ailus@...ux.intel.com,
	laurent.pinchart@...asonboard.com
CC:	linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
	Shuah Khan <shuahkh@....samsung.com>
Subject: Re: [PATCH 1/5] media: add media token device resource framework

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