From patchwork Thu Jul 4 13:44:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 2823771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B5E7F9F9D2 for ; Thu, 4 Jul 2013 13:45:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F51F201BA for ; Thu, 4 Jul 2013 13:45:20 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A380201BD for ; Thu, 4 Jul 2013 13:45:15 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UujqS-0005QG-7b; Thu, 04 Jul 2013 13:45:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UujqP-0000K8-Ex; Thu, 04 Jul 2013 13:45:09 +0000 Received: from mail-ie0-x22c.google.com ([2607:f8b0:4001:c03::22c]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UujqM-0000J0-5M for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2013 13:45:06 +0000 Received: by mail-ie0-f172.google.com with SMTP id 16so3246760iea.17 for ; Thu, 04 Jul 2013 06:44:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QfiuRLGyG1gE7xNQoKtxdwkLYayOLYcoGHsOcEc/W9o=; b=pisW/55xRyXbNKHwx/iO/GpFsu49MSGXAOmOPd3G1e+MyOMPShOq4LWenURkqcWrJj /WmTUMHLjX88qlZJxLfR8KDxobwvxk9dJ4yG1VkIVSkv909q7OyOj8U9uztJi7FqM7Cb Qix+Fay6XmU9U9la75bnpit2eKJSkkAy1q7mcTq1cW/Q183LkUsxQ1SZb3vnDkiaPmNL mkDMj2zrTaJjAeYE+89zY8KRd8RIwUzwFIsXK/jRbXnCsX0Ge1Y508yQMteS30ztRFId vthLt+pV3TCgQOhjbwJeM77Tkc0+fFnDYUWL4uLsgN1Ems/4IFFa2YTnuPZ3j03Rlmre 4bUQ== X-Received: by 10.43.46.134 with SMTP id uo6mr2434998icb.96.1372945482708; Thu, 04 Jul 2013 06:44:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.19.10 with HTTP; Thu, 4 Jul 2013 06:44:21 -0700 (PDT) In-Reply-To: <51D4CC94.3020908@atmel.com> References: <1372667978-4718-1-git-send-email-richard.genoud@gmail.com> <1372667978-4718-2-git-send-email-richard.genoud@gmail.com> <51D24299.9050209@atmel.com> <51D29927.80900@atmel.com> <51D4CC94.3020908@atmel.com> From: Richard Genoud Date: Thu, 4 Jul 2013 15:44:21 +0200 Message-ID: Subject: Re: [RFC PATCH 01/13] misc: atmel_ssc: add device tree DMA support To: Bo Shen X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130704_094506_267074_E1B989BF X-CRM114-Status: GOOD ( 23.18 ) X-Spam-Score: -2.0 (--) Cc: devicetree-discuss@lists.ozlabs.org, Nicolas Ferre , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 2013/7/4 Bo Shen : > Hi Richard, > > > On 7/3/2013 23:51, Richard Genoud wrote: >>> >>> >but there's a violent hang (kernel stops, no trace) when I try the >>> > record : >>> >arecord -v -V stereo -Dplug:default -f cd -t wav -c 2 /tmp/toto.wav >>> >last thing I see is : >>> >dma dma0chan3: atc_control (3) > > > I don't meet this issue. Playback and recording works well on my side on > at91sam9g35ek board. > > >>> >I'll try to trace that. >> >> I think it's DMA related. >> the last thing done by the kernel is: >> i2c i2c-0: i2c_outb: 0x34 A >> i2c i2c-0: i2c_outb: 0x0c A >> i2c i2c-0: i2c_outb: 0x5a A >> meaning: enable power on, LINE IN, ADC, OSC, on the WM8731 >> so, after that, data is comming from the codec to the SSC and then is >> handled by the DMA. >> there must be something nasty on the DMA bus to hang everything like >> that... > > > Will you try i2c without DMA support to test this issue? Ok, I nailed it ! To be sure we are on the same base, here is what I have done: onto next-20130704: - your 5 patches: ASoC: atmel_ssc_dai: move set dma data to startup callback ASoC: atmel_ssc_dai: add error mask define ASoC: atmel-pcm-dma: move prepare for dma to dai prepare ARM: atmel-ssc: change phybase type to dma_addr_t ASoC: atmel-pcm: use generic dmaengine framework - my patches 4-8: ARM: at91: DTS: sam9x5: add SSC DMA parameters ARM: AT91: DTS: sam9x5ek: add WM8731 codec ARM: AT91: DTS: sam9x5ek: add sound configuration ARM: AT91: DTS: sam9x5ek: enable SSC sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards To be sure that dma-I2c doesn't disturb something, I use i2c gpio bitbang: i.e. when I revert "ASoC: atmel_ssc_dai: add error mask define", I don't see any hang. Could you test and confirm that behaviour please ? I attached a the (simple) .config I used for the tests. PS: I hope the patches won't be mangled by gmail... Best regards, Richard. diff --git a/arch/arm/boot/dts/at91sam9x5ek.dtsi b/arch/arm/boot/dts/at91sam9x5ek.dtsi index 6684d4b..53a991e 100644 --- a/arch/arm/boot/dts/at91sam9x5ek.dtsi +++ b/arch/arm/boot/dts/at91sam9x5ek.dtsi @@ -57,15 +57,6 @@ status = "okay"; }; - i2c0: i2c@f8010000 { - status = "okay"; - - wm8731: wm8731@1a { - compatible = "wm8731"; - reg = <0x1a>; - }; - }; - pinctrl@fffff400 { mmc0 { pinctrl_board_mmc0: mmc0-board { @@ -114,6 +105,15 @@ }; }; + i2c@0 { + status = "okay"; + + wm8731: wm8731@1a { + compatible = "wm8731"; + reg = <0x1a>; + }; + }; + sound { compatible = "atmel,sam9x5-audio-wm8731"; with that configuration, it hangs when I do a: arecord -v -V stereo -Dplug:default -f cd -t wav -c 2 /tmp/toto.wav Now, if I remove the overrun error on ssc in rx_mask: diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 0ecf356..c04e825 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -83,7 +83,6 @@ static struct atmel_ssc_mask ssc_rx_mask = { .ssc_disable = SSC_BIT(CR_RXDIS), .ssc_endx = SSC_BIT(SR_ENDRX), .ssc_endbuf = SSC_BIT(SR_RXBUFF), - .ssc_error = SSC_BIT(SR_OVRUN), .pdc_enable = ATMEL_PDC_RXTEN, .pdc_disable = ATMEL_PDC_RXTDIS, }; It doesn't hang any more doing a simple record. BUT it still hangs if we do record and play at the same time. Removing the overrun on tx_mask prevent the hang: diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 0ecf356..41e15c2 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -73,7 +73,6 @@ static struct atmel_ssc_mask ssc_tx_mask = { .ssc_disable = SSC_BIT(CR_TXDIS), .ssc_endx = SSC_BIT(SR_ENDTX), .ssc_endbuf = SSC_BIT(SR_TXBUFE), - .ssc_error = SSC_BIT(SR_OVRUN), .pdc_enable = ATMEL_PDC_TXTEN, .pdc_disable = ATMEL_PDC_TXTDIS, };