Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3750610imm; Mon, 30 Jul 2018 02:49:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf/kDHaCKsCnVY+lrpIJ/+qXvD2kFYEYxvsSH+Igp+yE7nKy0Xq3K77rzxD6sh4jYQ1yPrb X-Received: by 2002:a63:a1a:: with SMTP id 26-v6mr15778056pgk.221.1532944188203; Mon, 30 Jul 2018 02:49:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532944188; cv=none; d=google.com; s=arc-20160816; b=soyNT1HOce8NKPzXBBZ1q5NoNoxUCb/VWGTKtKLzrJZ4tWDk3vESyUA4xew363uCWB R2R4GlsMW8OQGwFaOta0zdF7kvRe60eQw+PxGTSfbPzYPk0nkd9zGzQytNNuv4r47LHz 9dTXpLe/lCbxOCLJXjiC+S7a1BGk0zXeQvVLacU3doygJPOvHVzxTkJf/jpGCoBzUkdV 2cQkmLkUPrbYDu01Kwrm5WI++F7flRz2CYVXg7GesPpy6pGOOK5D0+ZO2cKht4i+JU1r ULi0YCPw/nGYIgcDtcNIARlb3hZLQ16qloS7fsoylxjmT9lcGtHPOwLrwIbLkofpOGjm IjFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=JY4e147qrLIjHXfj4/M2yrotXQxTEl90wjomtXqnbQI=; b=wkqR6I5Ojx8rUHBq7Nd8d4EVPZQYlLvQ5eET7iyMJDb1ZlOIBVJcRTf2SsX/qKQrzH 8mNDbdxTurWJfhkuAGB/I64JhKRlCJoi2I5dW7av3aKCG0GfxKkI00E3BO47ptqoEoXl h5wqzE0xi7xgIvd3QPGnU9NVseLAX5A2hOy+aXBFbe2TVSmPjqznPjMyUb2R8/wKQKLv LHteImM+ytZX3n/SrUBjrYgXPikGKxSvK3MNC0Wqr71HWfTl06KwkhENtRfgjFEu6VFO YgUMBRnHZXlMJTH8Z16vBOsRSzQOsTHyFbq2vWK9XKuj82814u7Fkcwzzccx6M1NkiLs tTEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="XYa/UVtK"; 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 z4-v6si10189667pgf.193.2018.07.30.02.49.10; Mon, 30 Jul 2018 02:49:48 -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="XYa/UVtK"; 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 S1727057AbeG3LU7 (ORCPT + 99 others); Mon, 30 Jul 2018 07:20:59 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:59420 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726663AbeG3LU7 (ORCPT ); Mon, 30 Jul 2018 07:20:59 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w6U9k9gi007029; Mon, 30 Jul 2018 04:46:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1532943969; bh=JY4e147qrLIjHXfj4/M2yrotXQxTEl90wjomtXqnbQI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=XYa/UVtK+kksIpZ75Thz1mK4pJw9l+GgrfWfKaBTb4piHSLtEkd54wtY03ltZ1Ann d0BYTge0Dlzk9TyEf4LfeBFGxlVoM2tHLQOaFYdISXBuuFfXYNW7K5G0EoOcW35hBf ktEczb7kwa94xQ6NbjJQWhvHmC+UYZMZSaeGrcKc= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w6U9k8tD025805; Mon, 30 Jul 2018 04:46:09 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 30 Jul 2018 04:46:08 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Mon, 30 Jul 2018 04:46:08 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w6U9k5H1026209; Mon, 30 Jul 2018 04:46:06 -0500 Subject: Re: [RFC] dmaengine: Add metadat_ops for dma_async_tx_descriptor To: Vinod CC: , , , , , , , , References: <32208a9c-2b15-d345-1432-f1e387531f9b@ti.com> <20180601102429.16429-1-peter.ujfalusi@ti.com> <20180710055230.GB3219@vkoul-mobl> <052ebdd9-7e68-5b78-52c3-304376f48777@ti.com> <20180719092224.GK3219@vkoul-mobl> <20180724111425.GK3219@vkoul-mobl> From: Peter Ujfalusi Message-ID: Date: Mon, 30 Jul 2018 12:46:14 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.0 MIME-Version: 1.0 In-Reply-To: <20180724111425.GK3219@vkoul-mobl> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit 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 Vinod, On 2018-07-24 14:14, Vinod wrote: >>>> Clients must not mix the two way of handling the metadata. >>>> The set_len() is intended to tell the DMA driver the client provided >>>> metadata size (in MEM_TO_DEV case mostly). >>>> >>>> MEM_TO_DEV flow on client side: >>>> get_ptr() >>>> fill in the metadata to the pointer (not exceeding max_len) >>>> set_len() to tell the DMA driver the amount of valid bytes written >>>> >>>> DEV_TO_MEM flow on client side: >>>> In the completion callback, get_ptr() >>>> the metadata is payload_len bytes and can be accessed in the return pointer. >>> >>> I would think to unify this.. >> >> I have tried it, but the attach mode and the pointer mode is hard to >> handle with a generic API. >> I will try to find a way to unify things in a sane way. > > Hmmm, looking from the description they will be for different methods, > so lets make them orthogonal and not allow driver to register both. I would allow DMA drivers to register both, but somehow enforce that clients are not mixing the two distinct way of dealing with the metadata. The reason for that is for example the attach mode is the simplest (I implemented it first and I have a client using it), but if the pointer mode is found to be more efficient and feasible for the DMA then the DMA driver can implement that mode and the client can move as well w/o breaking anything. > >> >> I have moved the metadata_ops to dma_async_tx_descriptor to emphasize >> that it is per descriptor setting: >> https://github.com/omap-audio/linux-audio/commit/02e095d1320a4bb3ae281ddb208ce82ead746f00#diff-92c0a79f414dc3be9dfc67a969c0dd71 >> >> >>>> BTW: The driver which is going to need this is now accessible in public: >>>> https://git.ti.com/ti-linux-kernel/ti-linux-kernel/trees/ti-linux-4.14.y/drivers/dma/ti >>>> >>>> or in my wip tree: >>>> https://github.com/omap-audio/linux-audio/tree/peter/ti-linux-4.14.y/wip/drivers/dma/ti >>>> >>>> prefixed with k3-* >>>> >> >> - Péter >> >> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. >> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki > - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki