Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp535727imm; Thu, 30 Aug 2018 05:20:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbGkn9Wh++fad5S4MprkCvi6ILhGhcH/LGW+7Ok7d96/uKgJlq6WL3b9CLfvFONsfqqufuN X-Received: by 2002:a17:902:49:: with SMTP id 67-v6mr10233401pla.206.1535631627095; Thu, 30 Aug 2018 05:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535631627; cv=none; d=google.com; s=arc-20160816; b=T9bdV4HO9jPm5MoNzNmm60FbZjwxpVMp/lTgAWWwzz2LsNYYDsYPdO0BUBuX7/ioyf RZShumWiWx4vcm+q+WwK8FYyIYyhozL9DvU4DttWyyq8eELWJMG+UznokTGO8MyUL2ZC U67dpMTPKac5a3h5wI12jZeROuu8c+TAE334lYfbifAWkmEwKFz5g9qI9CUu7yq0LE7h dfDyxQxUc/IEyiJvbp1lo7Av2t5s950gZ3818f6T5O347Z6XkP2wHLlm3YU3LkJ6YkBT mLo4aGQr3Z/0LOhuP0dD8CgBrUvMGngzRmwuGV8j0gH/906zKiNirgd7ZvOre4G/tS7z NDlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=EAM3Bd2/5gveLhHgeRsf+3mZK5d36WW10G3Z0bjhRHE=; b=UKvjLY47zeWstI+BMWSUvAj9FrFBpCQBJcasBen6Xs1Ww11zwdvuMaAeJV4LiB4Guc zD8hbK1WEHmHliQAu8o/+T07yVlqhFMh8iUx1mhaxFYdfgcyvYjzNLyDc13BcMT2rLRn wtRrbmpCRjwRJ0QUksT8yUwKePnvRvlWtn17KqhvXLVxtmWGUKltOqILKVoIc21BBi+N Tji2HOnsR5CrURunDG0a8wCRQlwZ1B0dwgOMtMFZqfIb9Fa5Lw+fhc+llZXEbapW+ya+ xnQW1/yX62BWmL1cFwZ4vfkSdUfRc6ZiGO9f1H6Yd1Yts4c8yZZStRjRZKW6JwjGHSwY lzyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CqEijag1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2-v6si5059362pli.100.2018.08.30.05.20.11; Thu, 30 Aug 2018 05:20:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=CqEijag1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728758AbeH3QU7 (ORCPT + 99 others); Thu, 30 Aug 2018 12:20:59 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:42942 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728120AbeH3QU6 (ORCPT ); Thu, 30 Aug 2018 12:20:58 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w7UCIjkA007066; Thu, 30 Aug 2018 07:18:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1535631526; bh=EAM3Bd2/5gveLhHgeRsf+3mZK5d36WW10G3Z0bjhRHE=; h=From:To:CC:Subject:Date; b=CqEijag1ScT4jXsVzERPqZVLGfACf2miWyFvABAtaYDMKeiRfpC9reu7CI1TwhW4z Zu4YRK0UJEFNpNPB8cOGh/q/f+nCFxUzd5nUJt7iDeU1Z2FvHQXwy9RAt+l13KLf1e +0zdsNrGc/Q2177kZD+Wy3g5+7MhySWHl+Bu5PLU= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7UCIj6D010076; Thu, 30 Aug 2018 07:18:45 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 30 Aug 2018 07:18:45 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 30 Aug 2018 07:18:45 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w7UCIhJx019829; Thu, 30 Aug 2018 07:18:43 -0500 From: Peter Ujfalusi To: , CC: , , , Subject: [PATCH v2 0/2] dmaengine: Add per descriptor metadata support Date: Thu, 30 Aug 2018 15:19:08 +0300 Message-ID: <20180830121910.16005-1-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Changes since v1: - Move code from header to dmaengine.c - Fix spelling - Use BIT() macro for bit definition - Update both provider and client documentation Changes since rfc: - DESC_METADATA_EMBEDDED renamed to DESC_METADATA_ENGINE - Use flow is added for both CLIENT and ENGINE metadata modes Some data movement architecure (DMA controller and peripherals) uses metadata associated with a transaction. The DMA controller role is to transfer the payload and the metadata alongside. The metadata itself is not used by the DMA engine itself, but it contains parameters, keys, vectors, etc for peripheral or from the peripheral. The DMAengine framework provides a generic ways to facilitate the metadata for descriptors. Depending on the architecture the DMA driver can implment either or both of the methods and it is up to the client driver to choose which one to use. 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 miss configuration. 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() Regards, Peter --- Peter Ujfalusi (2): dmaengine: Add metadata_ops for dma_async_tx_descriptor dmaengine: doc: Add sections for per descriptor metadata support Documentation/driver-api/dmaengine/client.rst | 70 ++++++++++++ .../driver-api/dmaengine/provider.rst | 46 ++++++++ drivers/dma/dmaengine.c | 73 ++++++++++++ include/linux/dmaengine.h | 108 ++++++++++++++++++ 4 files changed, 297 insertions(+) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki