From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbbJOKrr (ORCPT ); Thu, 15 Oct 2015 06:47:47 -0400 Received: from regular2.263xmail.com ([211.157.152.3]:60740 "EHLO regular2.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751210AbbJOKrp (ORCPT ); Thu, 15 Oct 2015 06:47:45 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: jay.xu@rock-chips.com X-FST-TO: xjq@rock-chips.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: jay.xu@rock-chips.com X-UNIQUE-TAG: <453eed7743f89506f2e7278f5114091c> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v6 10/10] ASoC: rockchip_i2s: modify DMA max burst to 1 To: Lars-Peter Clausen , Shawn Lin , Vinod Koul , Heiko Stuebner , Jaroslav Kysela , Takashi Iwai , Mark Brown References: <1444872865-2169-1-git-send-email-shawn.lin@rock-chips.com> <1444873008-2589-1-git-send-email-shawn.lin@rock-chips.com> <561F6990.7080809@metafoo.de> Cc: Doug Anderson , Olof Johansson , Sonny Rao , Addy Ke , Boojin Kim , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, Yiwei Cai , Jianqun Xu From: Jianqun Xu Message-ID: <561F843E.8040803@rock-chips.com> Date: Thu, 15 Oct 2015 18:47:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <561F6990.7080809@metafoo.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2015年10月15日 16:53, Lars-Peter Clausen 写道: > On 10/15/2015 03:36 AM, Shawn Lin wrote: > [...] >> + >> + if (snd_dmaengine_pcm_get_caps(&pdev->dev, &dma_caps) == 0) { >> + if (dma_caps.max_burst > 4) { >> + i2s->playback_dma_data.maxburst = 4; >> + i2s->capture_dma_data.maxburst = 4; >> + } else { >> + i2s->playback_dma_data.maxburst = 1; >> + i2s->capture_dma_data.maxburst = 1; > So this is what this is all about? I though you might have to program some > FIFO threshold registers in the peripheral itself. > > But it seems all this does is to read the maximum burst length from the DMA > controller only to tell the DMA controller that this is the maximum burst > length it should use. That seems rather unnecessary. > > The maxburst field of the dma_data indicates the maximum burst length that > the audio peripheral can handle. Typically this is the number of samples the > audio FIFO can receive without overflowing after sending the DMA request > signal. Since as the name suggests this is the maximum burst size the DMA > controller is free to choose a burst size smaller than this when writing > data to the peripheral. > > So in your case instead of introducing all these facilities to query the > maximum burst size it should be OK to simply reduce the burst size in the > DMA controller itself when it gets a request with a burst size larger than > it can handle, or is there a reason why this is not possible? Agree with Lars, it's better to fix on DMA driver side since issue caused by dma-controller instead of i2s controller > > - Lars > > > -- Jianqun Xu | Software engineer | 18750760928