Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 220F2C5519F for ; Wed, 18 Nov 2020 14:51:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56258246EB for ; Wed, 18 Nov 2020 14:51:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="a2uAU1Ya" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56258246EB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 929C21718; Wed, 18 Nov 2020 15:50:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 929C21718 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1605711069; bh=t5Yb8GXKBp5Novug9qgpjb6TCuxv3XCBSRaynX4wsBw=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=a2uAU1YaP9owIFhLPH5Gi/oVEhehQ+Oia49FzYj5nRXbDl5l0eWpa5GpDj2fdnqce /re6E8afxky6wrlKlPd4U08HKN1gOU2+DIeqeeRiTaoutv4IuAhsBsAYCaOA0nkjFZ xZiFQ8YREgwniaGzxE87ytlEflMR6kwc3jCnoPvM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 23399F80168; Wed, 18 Nov 2020 15:50:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9494CF8016C; Wed, 18 Nov 2020 15:50:17 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7BF7DF800EE for ; Wed, 18 Nov 2020 15:50:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7BF7DF800EE IronPort-SDR: i8qGCnQ5lUuy+kyeDpNHzQlKOzRPvmRw2wHdMs5sR1xW6CKKYuPzVZUyWQSI1BFVrDjlAOcMnO lzGCG4UlUMQA== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="232738392" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="232738392" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:49:56 -0800 IronPort-SDR: SD4LQtA8OwebcGCwYTPIB3u3wWS4Dux0HJLhb+YT1P00Hoyfi4yJXPCHMboxXDX4H5EAHGe4bb T7vBshafw1YA== X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="368356571" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 06:49:53 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kfOnP-007eko-Eq; Wed, 18 Nov 2020 16:50:55 +0200 Date: Wed, 18 Nov 2020 16:50:55 +0200 From: "Shevchenko, Andriy" To: "Sia, Jee Heng" Subject: Re: [RFC PATCH 2/4] ASoC: soc-generic-dmaengine-pcm: Add custom prepare and submit function Message-ID: <20201118145055.GW4077@smile.fi.intel.com> References: <20201117080354.4309-1-michael.wei.hong.sit@intel.com> <20201117080354.4309-4-michael.wei.hong.sit@intel.com> <20201117155038.GO4077@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: "Rojewski, Cezary" , "lars@metafoo.de" , "alsa-devel@alsa-project.org" , "pierre-louis.bossart@linux.intel.com" , "tiwai@suse.com" , "liam.r.girdwood@linux.intel.com" , "vkoul@kernel.org" , "broonie@kernel.org" , "Sit, Michael Wei Hong" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Wed, Nov 18, 2020 at 02:34:22AM +0200, Sia, Jee Heng wrote: > > From: Andy Shevchenko > > Sent: 17 November 2020 11:51 PM > > On Tue, Nov 17, 2020 at 04:03:48PM +0800, Michael Sit Wei Hong wrote: > > > Enabling custom prepare and submit function to overcome DMA limitation. > > > > > > In the Intel KeemBay solution, the DW AXI-based DMA has a limitation > > > on the number of DMA blocks per transfer. In the case of 16 bit audio > > > ASoC would allocate blocks exceeding the DMA block limitation. > > > > I'm still not sure the hardware has such a limitation. > > > > The Synopsys IP supports linked list (LLI) transfers and I hardly can imagine the > > list has any limitation. Even though, one can always emulate LLI in software how > > it's done in the DesignWare AHB DMA driver. > > > > I have briefly read chapter 4.6 "AXI_DMA" of Keem Bay TRM and didn't find any > > errata or limits like this. > [>>] Intel KeemBay datasheet can be found at below link: > https://www.intel.com/content/www/us/en/secure/design/confidential/products-and-solutions/processors-and-chipsets/keem-bay/technical-library.html?grouping=EMT_Content%20Type&sort=title:asc > Pg783, "Programmable transfer length (block length), max 1024". Sub-list can't exceed 1024 blocks. > BTW, I think the 16bits audio could be a confusion because it is not about the number of bits, but rather the constraint of the block length. Base on my understanding, Audio needs a period larger than 10ms, regardless of the bit depth. > The questions here are: > 1. Should DMAEngine expose a new API to constraint the block_length (instead of size in bytes)? > 2. Should DMA client re-split the linked-list before passing the linked-list to DMAEngine. > 3. Should DMA controller driver re-split the linked-list before execution. Since we have DMA slave capabilities, the consumer may ask for them and prepare the SG list accordingly. Above limitation is a block size (value of 1023 is a maximum, meaning 1024 maximum items in the block of given transfer width). So, like DesignWare DMA (AHB) has up to 4095 (but I saw hardware with 2047) or iDMA 32- and 64-bit have 131071. There is no limitation for amount of blocks of given maximum length in the LLI! No hacks are needed, really. -- With Best Regards, Andy Shevchenko