From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Mack Subject: Re: [PATCH] ALSA: ASoC: move dma_data from snd_soc_dai to snd_soc_pcm_stream Date: Thu, 18 Mar 2010 19:28:13 +0100 Message-ID: <20100318182813.GM30801@buzzloop.caiaq.de> References: <1268933737.3773.36.camel@odin> <1268935739-2931-1-git-send-email-daniel@caiaq.de> <20100318182211.GH6142@rakim.wolfsonmicro.main> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from buzzloop.caiaq.de (buzzloop.caiaq.de [212.112.241.133]) by alsa0.perex.cz (Postfix) with ESMTP id 022BD1038A5 for ; Thu, 18 Mar 2010 19:28:17 +0100 (CET) Content-Disposition: inline In-Reply-To: <20100318182211.GH6142@rakim.wolfsonmicro.main> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: alsa-devel@alsa-project.org, Sven Neumann , Michael Hirsch , Liam Girdwood List-Id: alsa-devel@alsa-project.org On Thu, Mar 18, 2010 at 06:22:11PM +0000, Mark Brown wrote: > On Thu, Mar 18, 2010 at 07:08:59PM +0100, Daniel Mack wrote: > > This fixes a memory corruption when using ASoC devices are used in > > full-duplex mode. Specifically for pxa-ssp code, where this pointer > > is dynamically allocated for each direction and destroyed upon each > > stream start. > > > All other platforms are fixed blindly, I couldn't even compile-test > > them. Sorry for any breakage I may have caused. > > Looks good at first pass, though I think there's some more platforms > have been missed? I'm just about to leave for today, Liam and I will > check properly tomorrow. Thanks for diagnosing this! This is all 'git grep' brought up. Other places should be easy to fix though in case I missed any. Thanks for double-checking. > > +static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, > > + const struct snd_pcm_substream *ss) > > +{ > > + return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? > > + dai->playback.dma_data : dai->capture.dma_data; > > +} > > + > > +static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, > > + const struct snd_pcm_substream *ss, > > + void *data) > > +{ > > + if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) > > + dai->playback.dma_data = data; > > + else > > + dai->capture.dma_data = data; > > +} > > Make your mind up if you like the ternery operator :P Well - I do, and I use it whereever I can. But in the 'set' case, I can't. Or did I miss the joke? ;)