All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Takashi Iwai <tiwai@suse.de>
Cc: Shuah Khan <shuahkh@osg.samsung.com>,
	m.chehab@samsung.com, akpm@linux-foundation.org,
	gregkh@linuxfoundation.org, crope@iki.fi, olebowle@gmx.com,
	dheitmueller@kernellabs.com, sakari.ailus@linux.intel.com,
	laurent.pinchart@ideasonboard.com, perex@perex.cz,
	prabhakar.csengg@gmail.com, tim.gardner@canonical.com,
	linux@eikelenboom.it, linux-media@vger.kernel.org,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/6] media: add media token device resource framework
Date: Tue, 21 Oct 2014 13:58:59 +0200	[thread overview]
Message-ID: <54464A83.7090706@xs4all.nl> (raw)
In-Reply-To: <s5h1tq1ljxj.wl-tiwai@suse.de>



On 10/21/2014 01:51 PM, Takashi Iwai wrote:
> At Tue, 21 Oct 2014 12:46:03 +0200,
> Hans Verkuil wrote:
>>
>> Hi Shuah,
>>
>> As promised, here is my review for this patch series.
>>
>> On 10/14/2014 04:58 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.
>>>
>>> A shared media tokens resource is created using devres framework
>>> for drivers to find and lock/unlock. Creating a shared devres
>>> helps avoid creating data structure dependencies between drivers.
>>> This media token resource contains media token for tuner, and
>>> audio. When tuner token is requested, audio token is issued.
>>
>> Did you mean: 'tuner token is issued' instead of audio token?
>>
>> I also have the same question as Takashi: why do we have an audio
>> token in the first place? While you are streaming audio over alsa
>> the underlying tuner must be marked as being in use. It's all about
>> the tuner, since that's the resource that is being shared, not about
>> audio as such.
>>
>> For the remainder of my review I will ignore the audio-related code
>> and concentrate only on the tuner part.
>>
>>> Subsequent token (for tuner and audio) gets from the same task
>>> and task in the same tgid succeed. This allows applications that
>>> make multiple v4l2 ioctls to work with the first call acquiring
>>> the token and applications that create separate threads to handle
>>> video and audio functions.
>>>
>>> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
>>> ---
>>>    MAINTAINERS                  |    2 +
>>>    include/linux/media_tknres.h |   50 +++++++++
>>>    lib/Makefile                 |    2 +
>>>    lib/media_tknres.c           |  237 ++++++++++++++++++++++++++++++++++++++++++
>>
>> I am still not convinced myself that this should be a generic API.
>> The only reason we need it today is for sharing tuners. Which is almost
>> a purely media thing with USB audio as the single non-media driver that
>> will be affected. Today I see no use case outside of tuners. I would
>> probably want to keep this inside drivers/media.
>>
>> If this is going to be expanded it can always be moved to lib later.
>
> Well, my argument is that it should be more generic if it were
> intended to be put in lib.  It'd be fine to put into drivers/media,
> but this code snippet must be a separate module.  Otherwise usb-audio
> would grab the whole media stuff even if not needed at all.

Certainly.

>
> (snip)
>> I also discovered that you are missing MODULE_AUTHOR, MODULE_DESCRIPTION
>> and above all MODULE_LICENSE. Without the MODULE_LICENSE it won't link this
>> module to the GPL devres_* functions. It took me some time to figure that
>> out.
>
> It was a code in lib, so it cannot be a module at all :)

Well, it depends on CONFIG_MEDIA_SUPPORT which is 'm' in my case, so it
compiles as a module :-)

Regards,

	Hans

  reply	other threads:[~2014-10-21 11:58 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-14 14:58 [PATCH v2 0/6] media token resource framework Shuah Khan
2014-10-14 14:58 ` [PATCH v2 1/6] media: add media token device " Shuah Khan
2014-10-15 17:05   ` Takashi Iwai
2014-10-16  0:53     ` Shuah Khan
2014-10-16 14:00       ` Takashi Iwai
2014-10-16 14:39         ` Shuah Khan
2014-10-21 10:46   ` Hans Verkuil
2014-10-21 11:51     ` Takashi Iwai
2014-10-21 11:58       ` Hans Verkuil [this message]
2014-10-21 13:07         ` Takashi Iwai
2014-11-18 21:33   ` Sakari Ailus
2014-10-14 14:58 ` [PATCH v2 2/6] media: v4l2-core changes to use media token api Shuah Khan
2014-10-14 14:58 ` [PATCH v2 3/6] media: au0828-video " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 4/6] media: dvb-core " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 5/6] sound/usb: pcm " Shuah Khan
2014-10-16 12:00   ` Lars-Peter Clausen
2014-10-16 12:00     ` [alsa-devel] " Lars-Peter Clausen
2014-10-16 13:10     ` Shuah Khan
2014-10-16 14:01       ` Takashi Iwai
2014-10-16 14:10         ` Shuah Khan
2014-10-16 14:16           ` Takashi Iwai
2014-10-16 14:39             ` Shuah Khan
2014-10-16 14:48               ` Takashi Iwai
2014-10-16 14:59                 ` Shuah Khan
2014-10-16 14:59                   ` [alsa-devel] " Shuah Khan
2014-10-18 18:49                   ` Mauro Carvalho Chehab
2014-10-19  9:00                     ` Takashi Iwai
2014-10-19  9:00                       ` [alsa-devel] " Takashi Iwai
2014-10-21 15:42                 ` Hans Verkuil
2014-10-21 16:05                   ` Takashi Iwai
2014-10-21 16:08                     ` Devin Heitmueller
2014-10-21 16:14                       ` Takashi Iwai
2014-10-22 19:26                       ` Pierre-Louis Bossart
2014-10-22 19:45                         ` Devin Heitmueller
2014-10-24 14:44                           ` Shuah Khan
2014-10-25 12:44                         ` Mauro Carvalho Chehab
2014-10-25 12:44                           ` [alsa-devel] " Mauro Carvalho Chehab
2014-10-25 13:20                         ` Mauro Carvalho Chehab
2014-10-25 13:41                         ` Mauro Carvalho Chehab
2014-10-25 13:41                           ` [alsa-devel] " Mauro Carvalho Chehab
2014-10-26  8:27                           ` Takashi Iwai
2014-10-27 12:52                             ` Mauro Carvalho Chehab
2014-10-28 21:15                               ` Shuah Khan
2014-10-28 23:42                                 ` [RFCv1] Media Token API needs - Was: " Mauro Carvalho Chehab
2014-10-29  0:00                                   ` Mauro Carvalho Chehab
2014-10-29 11:19                                     ` Mauro Carvalho Chehab
2014-10-29 16:06                                   ` Shuah Khan
2014-10-29 17:56                                     ` Mauro Carvalho Chehab
2014-11-04 23:08                                       ` [RFCv2] Media Token API Spec Shuah Khan
2014-11-10 14:15                                         ` Hans Verkuil
2014-11-10 14:15                                           ` Hans Verkuil
2014-11-18 21:15                                         ` Sakari Ailus
2014-11-18 21:27                                           ` Shuah Khan
2014-10-21 17:32                     ` [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api Shuah Khan
2014-10-22 15:24                       ` Hans Verkuil
2014-10-25 10:57                       ` Mauro Carvalho Chehab
2014-10-27 15:47                         ` [alsa-devel] " Shuah Khan
2014-10-14 14:58 ` [PATCH v2 6/6] media: au0828-core changes to create and destroy media Shuah Khan
2014-10-15 16:48 ` [PATCH v2 0/6] media token resource framework Takashi Iwai
2014-10-15 20:21   ` Shuah Khan
2014-10-16 14:02     ` Takashi Iwai
2014-10-29  9:17 ` Sakari Ailus
2014-10-29  9:33   ` Mauro Carvalho Chehab
2014-10-29  9:33     ` Mauro Carvalho Chehab

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=54464A83.7090706@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=akpm@linux-foundation.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=crope@iki.fi \
    --cc=dheitmueller@kernellabs.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@eikelenboom.it \
    --cc=m.chehab@samsung.com \
    --cc=olebowle@gmx.com \
    --cc=perex@perex.cz \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shuahkh@osg.samsung.com \
    --cc=tim.gardner@canonical.com \
    --cc=tiwai@suse.de \
    /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.