From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 85222ECE58D for ; Wed, 9 Oct 2019 07:37:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5AFD1218AC for ; Wed, 9 Oct 2019 07:37:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u8Y3Vl5c"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="uvYSScH8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5AFD1218AC Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9pHAfULhKEkiiQ7LzLbuCZjq68m0rLYO38N4iYRTBEQ=; b=u8Y3Vl5cA1QLLartWymy6EDMi oXWmo/5I7ZULNeW/WHXfToyi5wnMIjxj035HV0kBUOZeq/5zGvCLVj+833EN82R8bCE9VTFtohMds BNCd3b1B4D3jMon3n0rdnpcCx1FduhFazVpvjYtjXTFaQtLX3inQJWfSydUUGH8DaVuUt33Ikjpf5 +UWigwIZToLOB2HEhS2M6SMcafrQqHab65Yiq11n+8KTqmTXRD8l5wcm2jSDjY0i+Eoa27kUA9774 RC2Btusv8hVoCOJoMnYDShry1GmHk4wCB1Z71h+s6n/q6Nr5Fz56sSAg1CjW1QJucng7KepfMsEMg E1cnF2dRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iI6XD-0005vw-P3; Wed, 09 Oct 2019 07:37:23 +0000 Received: from lelv0142.ext.ti.com ([198.47.23.249]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iI6XA-0005vS-Qn for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2019 07:37:22 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x997bF5W009620; Wed, 9 Oct 2019 02:37:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1570606635; bh=GCItb3o8zhNxqRL1dRRtIRmWKNz8QsnOl1OUx9AOT4I=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=uvYSScH8JQexfEgbwLHmKsT+mxIii8+PYvvzx80wIrWuyzqCrneKqYeRU+c3v5TjR 33258nGN8c2GtCF3hKAtxp+bQMLqGjQpQwxQpuqucOv9w2b9AS4gthrF8nqgz3lx3Z 365eJkW25sexQFudnADgsBKL4aWPCohdphSn5LH4= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x997bFWP060657 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Oct 2019 02:37:15 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 9 Oct 2019 02:37:13 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 9 Oct 2019 02:37:13 -0500 Received: from [127.0.0.1] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x997bAx9121069; Wed, 9 Oct 2019 02:37:10 -0500 Subject: Re: [PATCH v3 04/14] dmaengine: Add metadata_ops for dma_async_tx_descriptor To: Peter Ujfalusi , , , , References: <20191001061704.2399-1-peter.ujfalusi@ti.com> <20191001061704.2399-5-peter.ujfalusi@ti.com> From: Tero Kristo Message-ID: <1d4e049b-737c-3904-2bb1-6e058ab69a4d@ti.com> Date: Wed, 9 Oct 2019 10:37:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191001061704.2399-5-peter.ujfalusi@ti.com> Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191009_003720_950383_C33A2E0A X-CRM114-Status: GOOD ( 21.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, grygorii.strashko@ti.com, lokeshvutla@ti.com, j-keerthy@ti.com, linux-kernel@vger.kernel.org, tony@atomide.com, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 01/10/2019 09:16, Peter Ujfalusi wrote: > The metadata is best described as side band data or parameters traveling > alongside the data DMAd by the DMA engine. It is data > which is understood by the peripheral and the peripheral driver only, the > DMA engine see it only as data block and it is not interpreting it in any > way. > > The metadata can be different per descriptor as it is a parameter for the > data being transferred. > > If the DMA supports per descriptor metadata it can implement the attach, > get_ptr/set_len callbacks. > > Client drivers must only use either attach or get_ptr/set_len to avoid > misconfiguration. > > Client driver can check if a given metadata mode is supported by the > channel during probe time with > dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_CLIENT); > dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_ENGINE); > > and based on this information can use either mode. > > Wrappers are also added for the metadata_ops. > > To be used in DESC_METADATA_CLIENT mode: > dmaengine_desc_attach_metadata() > > To be used in DESC_METADATA_ENGINE mode: > dmaengine_desc_get_metadata_ptr() > dmaengine_desc_set_metadata_len() > > Signed-off-by: Peter Ujfalusi Again couple of typos below, but other than that: Reviewed-by: Tero Kristo > --- > drivers/dma/dmaengine.c | 73 ++++++++++++++++++++++++++ > include/linux/dmaengine.h | 108 ++++++++++++++++++++++++++++++++++++++ > + * @DESC_METADATA_ENGINE - the metadata buffer is allocated/managed by the DMA > + * driver. The client driver can ask for the pointer, maximum size and the > + * currently used size of the metadata and can directly update or read it. > + * dmaengine_desc_get_metadata_ptr() and dmaengine_desc_set_metadata_len() is > + * provided as helper functions. > + * > + * Client drivers interested to use this mode can follow: > + * - DMA_MEM_TO_DEV / DEV_MEM_TO_MEM: > + * 1. prepare the descriptor (dmaengine_prep_*) > + * 2. use dmaengine_desc_get_metadata_ptr() to get the pointer to the engine's > + * metadata area > + * 3. update the metadata at the pointer > + * 4. use dmaengine_desc_set_metadata_len() to tell the DMA engine the amount > + * of data the client has placed into the metadata buffer > + * 5. submit the transfer > + * - DMA_DEV_TO_MEM: > + * 1. prepare the descriptor (dmaengine_prep_*) > + * 2. submit the transfer > + * 3. on transfer completion, use dmaengine_desc_get_metadata_ptr() to get the > + * pointer to the engine's metadata are are = area? > + * 4. Read out the metadate from the pointer metadate = metadata? -- Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel