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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56D0B0CB.8060709@osg.samsung.com>
Date:	Fri, 26 Feb 2016 13:08:43 -0700
From:	Shuah Khan <shuahkh@....samsung.com>
To:	Takashi Iwai <tiwai@...e.de>
Cc:	hans.verkuil@...co.com, laurent.pinchart@...asonboard.com,
	clemens@...isch.de, sakari.ailus@...ux.intel.com,
	javier@....samsung.com, mchehab@....samsung.com,
	geliangtang@....com, alsa-devel@...a-project.org, arnd@...db.de,
	ricard.wanderlof@...s.com, labbott@...oraproject.org,
	chehabrafael@...il.com, klock.android@...il.com,
	misterpib@...il.com, prabhakar.csengg@...il.com,
	ricardo.ribalda@...il.com, ruchandani.tina@...il.com,
	takamichiho@...il.com, tvboxspy@...il.com, dominic.sacre@....de,
	albert@...tsing.nl, crope@....fi, julian@...st.de,
	pierre-louis.bossart@...ux.intel.com, corbet@....net,
	joe@...po.co.uk, johan@...ud.se, dan.carpenter@...cle.com,
	pawel@...iak.com, p.zabel@...gutronix.de, perex@...ex.cz,
	stefanr@...6.in-berlin.de, inki.dae@...sung.com,
	j.anaszewski@...sung.com, jh1009.sung@...sung.com,
	k.kozlowski@...sung.com, kyungmin.park@...sung.com,
	m.szyprowski@...sung.com, nenggun.kim@...sung.com,
	sw0312.kim@...sung.com, elfring@...rs.sourceforge.net,
	linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
	linuxbugs@...tgam.net, gtmkramer@...all.nl, normalperson@...t.net,
	daniel@...que.org
Subject: Re: [PATCH v3 22/22] sound/usb: Use Media Controller API to share
 media resources

On 02/26/2016 12:55 PM, Takashi Iwai wrote:
> On Fri, 12 Feb 2016 00:41:38 +0100,
> Shuah Khan wrote:
>>
>> Change ALSA driver to use Media Controller API to
>> share media resources with DVB and V4L2 drivers
>> on a AU0828 media device. Media Controller specific
>> initialization is done after sound card is registered.
>> ALSA creates Media interface and entity function graph
>> nodes for Control, Mixer, PCM Playback, and PCM Capture
>> devices.
>>
>> snd_usb_hw_params() will call Media Controller enable
>> source handler interface to request the media resource.
>> If resource request is granted, it will release it from
>> snd_usb_hw_free(). If resource is busy, -EBUSY is returned.
>>
>> Media specific cleanup is done in usb_audio_disconnect().
>>
>> Signed-off-by: Shuah Khan <shuahkh@....samsung.com>
>> ---
>>  sound/usb/Kconfig        |   4 +
>>  sound/usb/Makefile       |   2 +
>>  sound/usb/card.c         |  14 +++
>>  sound/usb/card.h         |   3 +
>>  sound/usb/media.c        | 318 +++++++++++++++++++++++++++++++++++++++++++++++
>>  sound/usb/media.h        |  72 +++++++++++
>>  sound/usb/mixer.h        |   3 +
>>  sound/usb/pcm.c          |  28 ++++-
>>  sound/usb/quirks-table.h |   1 +
>>  sound/usb/stream.c       |   2 +
>>  sound/usb/usbaudio.h     |   6 +
>>  11 files changed, 448 insertions(+), 5 deletions(-)
>>  create mode 100644 sound/usb/media.c
>>  create mode 100644 sound/usb/media.h
>>
>> diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig
>> index a452ad7..ba117f5 100644
>> --- a/sound/usb/Kconfig
>> +++ b/sound/usb/Kconfig
>> @@ -15,6 +15,7 @@ config SND_USB_AUDIO
>>  	select SND_RAWMIDI
>>  	select SND_PCM
>>  	select BITREVERSE
>> +	select SND_USB_AUDIO_USE_MEDIA_CONTROLLER if MEDIA_CONTROLLER && MEDIA_SUPPORT
> 
> Looking at the media Kconfig again, this would be broken if
> MEDIA_SUPPORT=m and SND_USB_AUDIO=y.  The ugly workaround is something
> like:
> 	select SND_USB_AUDIO_USE_MEDIA_CONTROLLER \
> 		if MEDIA_CONTROLLER && (MEDIA_SUPPORT=y || MEDIA_SUPPORT=SND)

My current config is MEDIA_SUPPORT=m and SND_USB_AUDIO=y
It is working and I didn't see any issues so far. Maybe
the current change is good. I am hoping kbuild-bot can
find issues (if any) once it gets merged.

> 
> Other than that, it looks more or less OK to me.
> The way how media_stream_init() gets called is a bit worrisome, but it
> should work practically.  Another concern is about the disconnection.
> Can all function calls in media_device_delete() be safe even if it's
> called while the application still opens the MC device?

Right. I have been looking into device removal path when
ioctls are active and I can resolve any issues that might
surface while an audio app is active when device is removed.

> 
> In anyway, such a thing can be improved later once after we get this
> merged, too.  So, feel fee to take my ack.
> 
>  Acked-by: Takashi Iwai <tiwai@...e.de>

thanks for the Ack
-- Shuah

> 
> 
> thanks,
> 
> Takashi
> 


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ