From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751819AbbJOIxp (ORCPT ); Thu, 15 Oct 2015 04:53:45 -0400 Received: from smtp-out-193.synserver.de ([212.40.185.193]:1072 "EHLO smtp-out-188.synserver.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751103AbbJOIxm (ORCPT ); Thu, 15 Oct 2015 04:53:42 -0400 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 911 Message-ID: <561F6990.7080809@metafoo.de> Date: Thu, 15 Oct 2015 10:53:36 +0200 From: Lars-Peter Clausen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Shawn Lin , Vinod Koul , Heiko Stuebner , Jaroslav Kysela , Takashi Iwai , Mark Brown 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 Subject: Re: [PATCH v6 10/10] ASoC: rockchip_i2s: modify DMA max burst to 1 References: <1444872865-2169-1-git-send-email-shawn.lin@rock-chips.com> <1444873008-2589-1-git-send-email-shawn.lin@rock-chips.com> In-Reply-To: <1444873008-2589-1-git-send-email-shawn.lin@rock-chips.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? - Lars