Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932199Ab3GDNoq (ORCPT ); Thu, 4 Jul 2013 09:44:46 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:47417 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756618Ab3GDNon (ORCPT ); Thu, 4 Jul 2013 09:44:43 -0400 MIME-Version: 1.0 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 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?= Content-Type: multipart/mixed; boundary=bcaec529a017cb012304e0afc717 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9736 Lines: 219 --bcaec529a017cb012304e0afc717 Content-Type: text/plain; charset=UTF-8 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: 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, }; 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. --bcaec529a017cb012304e0afc717 Content-Type: application/octet-stream; name=snd_9x5_defconfig Content-Disposition: attachment; filename=snd_9x5_defconfig Content-Transfer-Encoding: base64 X-Attachment-Id: f_hiq07ypt0 IyBDT05GSUdfTE9DQUxWRVJTSU9OX0FVVE8gaXMgbm90IHNldAojIENPTkZJR19TV0FQIGlzIG5v dCBzZXQKQ09ORklHX1NZU1ZJUEM9eQpDT05GSUdfTE9HX0JVRl9TSElGVD0xNApDT05GSUdfQkxL X0RFVl9JTklUUkQ9eQpDT05GSUdfQ0NfT1BUSU1JWkVfRk9SX1NJWkU9eQpDT05GSUdfS0FMTFNZ TVNfQUxMPXkKQ09ORklHX0VNQkVEREVEPXkKQ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z15CkNP TkZJR19ETUFERVZJQ0VTX1ZERUJVRz15CkNPTkZJR19BVF9IRE1BQz15CiMgQ09ORklHX0lPTU1V X1NVUFBPUlQgaXMgbm90IHNldApDT05GSUdfRkFOT1RJRlk9eQpDT05GSUdfVE1QRlM9eQpDT05G SUdfQ09ORklHRlNfRlM9eQojIENPTkZJR19NSVNDX0ZJTEVTWVNURU1TIGlzIG5vdCBzZXQKQ09O RklHX05GU19GUz15CkNPTkZJR19ST09UX05GUz15CkNPTkZJR19QUklOVEtfVElNRT15CkNPTkZJ R19ERUZBVUxUX01FU1NBR0VfTE9HTEVWRUw9NwojIENPTkZJR19TQ0hFRF9ERUJVRyBpcyBub3Qg c2V0CkNPTkZJR19ERUJVR19JTkZPPXkKIyBDT05GSUdfRlRSQUNFIGlzIG5vdCBzZXQKQ09ORklH X0RFQlVHX1VTRVI9eQpDT05GSUdfQ1JZUFRPX0NSQzMyQz15CiMgQ09ORklHX0NSWVBUT19BTlNJ X0NQUk5HIGlzIG5vdCBzZXQKIyBDT05GSUdfQ1JZUFRPX0hXIGlzIG5vdCBzZXQKQ09ORklHX0NS QzE2PXkK --bcaec529a017cb012304e0afc717-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/