From patchwork Mon Dec 2 10:12:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 295859 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C445C2C009A for ; Mon, 2 Dec 2013 21:21:21 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQcf-0007tb-N6; Mon, 02 Dec 2013 10:21:01 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQcd-0000UG-AJ; Mon, 02 Dec 2013 10:20:59 +0000 Received: from mail-ie0-f169.google.com ([209.85.223.169]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VnQca-0000T8-DT for linux-arm-kernel@lists.infradead.org; Mon, 02 Dec 2013 10:20:57 +0000 Received: by mail-ie0-f169.google.com with SMTP id e14so20947150iej.28 for ; Mon, 02 Dec 2013 02:20:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=iZx/CHvBDw3rfdQ1z4+QAS7Eo6iemf0U3P4zoDxaMZg=; b=DR46W7+S8lwYL9+Lt5o3vrB4mu1Uqi9neOGTZDpoHfwT97ibi9G0rx+k8P8ZM7Lddh /7fBGYBa0Skdsn3x4Of6e2dwAZJTCoqwmBeBifvQr9CwiMf9+1kFmT7URZjYTlnWuaHg /5jtrqThPB3k79TepeQ1L1G1zBQVTd8O2jONP2SbndfqlPjglwOPZXR3jXQx7idEG8K9 LYFzAxbiS6yXGehAzn8lbF1Nwti96+0biLBNE97qG3q+KFMG6bOFnUsAXqzT9GbitmgF 7oKqVajhiT1PaBO0Rg0kqmiUzjeYKiOv/UvfhraBmrfRMUGUAre6/fi8Vnp4TPakDjIV RnBA== X-Gm-Message-State: ALoCoQnk7VRhrUV10mpspQcR8IKJBibGMYMI0D6gD7/ZrevZJueRm/0gAGYIwF67sm2AbgQAwl9g X-Received: by 10.42.113.66 with SMTP id b2mr22112270icq.21.1385979181393; Mon, 02 Dec 2013 02:13:01 -0800 (PST) Received: from lee--X1 (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id qi3sm65250459igc.8.2013.12.02.02.12.59 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 02 Dec 2013 02:13:00 -0800 (PST) Date: Mon, 2 Dec 2013 10:12:56 +0000 From: Lee Jones To: Olof Johansson Subject: Re: [alsa-devel] [PATCH 07/10] ASoC: ux500: Store DMA data in the DAI differently in the pdata and DT case Message-ID: <20131202101256.GA29373@lee--X1> References: <1384859269-19801-1-git-send-email-lee.jones@linaro.org> <1384859269-19801-8-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131202_052056_477545_42299264 X-CRM114-Status: GOOD ( 27.60 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.223.169 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "alsa-devel@alsa-project.org" , LinusW , Mark Brown , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On Sun, 01 Dec 2013, Olof Johansson wrote: > Hi, > > On Tue, Nov 19, 2013 at 3:07 AM, Lee Jones wrote: > > In this patch we do two things. Firstly, instead of open coding the > > store of DMA data in to the DAI for later use, we use the API provided. > > Secondly we create and store similar DMA data for the DT case, only > > this time we use 'struct snd_dmaengine_dai_dma_data' which is provided > > by the core for this very reason. > > > > Cc: alsa-devel@alsa-project.org > > Cc: Mark Brown > > Acked-by: Linus Walleij > > Signed-off-by: Lee Jones > > > Seems like this hit -next for the first time today, and it panics > snowball on boot of u8500_defconfig. I bisected down to this patch. > > The panic is below. Last output is the dev_dbg() in > ux500_pcm_request_chan. dma_cfg seems to be 0x0000004(!) at that > point. It's indeed crashing on first deref of dma_cfg (confirmed via > addr2line). Okay, I just debugged this. It's actually my fault. I had two patches round the wrong way in the series. The imediately subsequent patch in the set fixes this issue: Author: Lee Jones Date: Tue Nov 5 22:57:31 2013 +0000 ASoC: ux500_pcm: Differentiate between pdata and DT initialisation If booting with full DT support (i.e. DMA too, the last piece of the puzzle), then we don't need to use the compatible request channel call back and, due to the work we laid down earlier in this patch-set, we can use core function calls to populate the DMA slave_config. We also require slightly different flags to inform the core that we 'are' booting with DT. Cc: alsa-devel@alsa-project.org Cc: Mark Brown Acked-by: Linus Walleij Signed-off-by: Lee Jones diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index ce554de..acfec98 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -139,15 +139,33 @@ static const struct snd_dmaengine_pcm_config ux500_dmaengine_pcm_config = { .prepare_slave_config = ux500_pcm_prepare_slave_config, }; +static const struct snd_dmaengine_pcm_config ux500_dmaengine_of_pcm_config = { + .pcm_hardware = &ux500_pcm_hw, + .prealloc_buffer_size = 128 * 1024, + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config, +}; + int ux500_pcm_register_platform(struct platform_device *pdev) { + const struct snd_dmaengine_pcm_config *pcm_config; + struct device_node *np = pdev->dev.of_node; + unsigned int pcm_flags; int ret; - ret = snd_dmaengine_pcm_register(&pdev->dev, - &ux500_dmaengine_pcm_config, - SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | - SND_DMAENGINE_PCM_FLAG_COMPAT | - SND_DMAENGINE_PCM_FLAG_NO_DT); + if (np) { + pcm_config = &ux500_dmaengine_of_pcm_config; + + pcm_flags = SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | + SND_DMAENGINE_PCM_FLAG_COMPAT; + } else { + pcm_config = &ux500_dmaengine_pcm_config; + + pcm_flags = SND_DMAENGINE_PCM_FLAG_NO_RESIDUE | + SND_DMAENGINE_PCM_FLAG_NO_DT | + SND_DMAENGINE_PCM_FLAG_COMPAT; + } + + ret = snd_dmaengine_pcm_register(&pdev->dev, pcm_config, pcm_flags); if (ret < 0) { dev_err(&pdev->dev, "%s: ERROR: Failed to register platform '%s' (%d)!\n",