Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5037513imm; Tue, 11 Sep 2018 23:45:27 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdajun/J2nFk2Z7L7M0PBi4cVdAcfigpfODQsZcDL1KGwCeCNcwOXNOAkR3ZIGS41G6ZrY5J X-Received: by 2002:a63:352:: with SMTP id 79-v6mr479817pgd.112.1536734727592; Tue, 11 Sep 2018 23:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536734727; cv=none; d=google.com; s=arc-20160816; b=WjcUgSJZvQAG7o790M7raui+Wm1FaBocrCkjwkkU5diXh6gYnA4sNhEor/3xoWoRUZ BbiJnqT+Z7Os2BOGBjkIkh7UHuMM59ICwF+jMXEl8nc8fTYEIdgJScuJYHUDNpcW3x3o 9JAFhStIRGsmZa0xPnpGAP7agGZ5tIKQI7EASmvEoyGxVPaXnXMEsjZ8DPFrNjSGcH2U 9OjquH0ikHAah3JdrQhSx3K11lb0c+EwmRs1HhYkGBzFkfamTRPGqPWlK1kl9DYL2/x8 Evl//uyWQ2+kROAD5BUk4y3Z/cNUYfMv/+VCLiCaOnE8ft/tRd+AyfUV4M+m//ReV/Ay Na1Q== 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; bh=6q8iyqj5wxI0EcZ9ihQJcaWonAP+V1VV6WcxAI2Wx0s=; b=U3vfmDF7/n2za5cr3F/4nFnrTTA6BK5pw2sroju1lZo67uK9N8CA+pjPy7L58Ykdl3 HMGpiXuqBe3qqxcuzL/LudoSjLGYh4qJecqh58dPKWXRJOz/CSFqNpA1LW40iajRO4WF mkLSc4EN+2m1xccYU8Rtq8WdMUshiFqvBCiJcD+6fhdB9Vbbf7QuKzz+xbCKdUw0/M7x o2ksQFedH26Gb82ESZ/wZhTiMWykNm4Q+WmCqSH63MIYawhr6E1QSQFcDFuCrkpsUODn DkzZEqEzvXeHFJRsB3mF5X77NI6d8A18WmD2poSl5v0YXfSRqlFUEduE/IhozdNUm8bz 41Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="yGG/13rm"; 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 w3-v6si159837pgw.135.2018.09.11.23.45.12; Tue, 11 Sep 2018 23:45: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="yGG/13rm"; 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 S1727010AbeILLsD (ORCPT + 99 others); Wed, 12 Sep 2018 07:48:03 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:44106 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbeILLsD (ORCPT ); Wed, 12 Sep 2018 07:48:03 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8C6icmK006120; Wed, 12 Sep 2018 01:44:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1536734678; bh=6q8iyqj5wxI0EcZ9ihQJcaWonAP+V1VV6WcxAI2Wx0s=; h=From:To:CC:Subject:Date; b=yGG/13rmJMv3nZWTkTmLQBtdsfsMFWYmRLk7QsxHfeAABlcRJgVq6vmLNSwwULbp4 pmxvXHXYMiLQV4cI6T2Pq2m14BoGi5Wk07CF7BbrIqcNxJh51SlH+hDkojTH5DgB5o XrBdXG3DR6fwt11o4VXEWBQpu5X8bk7+za1teLh8= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8C6ic6U011845; Wed, 12 Sep 2018 01:44:38 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 12 Sep 2018 01:44:38 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 12 Sep 2018 01:44:38 -0500 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8C6iZBR013004; Wed, 12 Sep 2018 01:44:36 -0500 From: Peter Ujfalusi To: , CC: , , , Subject: [PATCH v3 0/2] dmaengine: Add per descriptor metadata support Date: Wed, 12 Sep 2018 09:45:10 +0300 Message-ID: <20180912064512.27306-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 v2: - EXPORT_SYMBOL_GPL() for the metadata functions - Added note to Documentation to not mix the two defined metadata modes - Fixed the typos in Documentation 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: doc: Add sections for per descriptor metadata support dmaengine: Add metadata_ops for dma_async_tx_descriptor Documentation/driver-api/dmaengine/client.rst | 75 ++++++++++++ .../driver-api/dmaengine/provider.rst | 46 ++++++++ drivers/dma/dmaengine.c | 73 ++++++++++++ include/linux/dmaengine.h | 108 ++++++++++++++++++ 4 files changed, 302 insertions(+) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki