Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4707964imm; Mon, 30 Jul 2018 21:30:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfHv18Kkpl6KNFgeLEs24q22MOe+nxKtFFo7dODcAskWMZ1eRpMpF0SgCx7Qxhq4hzJd9Su X-Received: by 2002:a17:902:7894:: with SMTP id q20-v6mr19338511pll.3.1533011410069; Mon, 30 Jul 2018 21:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533011410; cv=none; d=google.com; s=arc-20160816; b=EWPNPztqczVJOnENk94NZGIrB0tCrPsTkenyL5bh6aRS18krubDhr3uSGCOIwtp/AS XjhEIZQEJyZ9DnzxzCoX42ioLd+XKh6Zd/eBx00W+xRrJeLJCIQ+76tD81LqMokFFNdj M+gEiMmE/l614sIpQGtocTevMPFJlgnbRl6sAo9BI0LtC3RTpChqodMeMvAiwuTWpJf5 YDws7KMsSILUr5cLInuhmlnLoJnOTgXp2SfRRWWXTkElmFwGl1nZYKAtLQHYR141y4Ie 3MVY9CAyPJ1jJ5ny7FQ+rLYLrQLaZ29v7TViv2d1pZDrHHHStA5wAHfhPRNzDonfHRRS mavw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Sw3bec4fzFg0wPBDJyidGPmXJLSl7tfUg4v1RzJoTlo=; b=mOnKbIOUnuklmpK0yr8UQK3HjGXY5+ArfWOnxavYGUuwiwmmnTrteUZ66jMm9oFm1a ymPb7SEvZ6ppXyr0ucjVKavoFYeKtKJh+uePu9B8QqYASoGK/W3xFmyCT/fWN3ne/RtT X3CTDjFdaO+fXHdIXFTJScaXEnTbjzkxw96fcS2JOrybZSw3SVdMbmgtMdc++7Xbboeu N6eOqPoaKhckBy0hbpfX+mWMHJ8exRqWIs3iKGklQIib+UfL9GpDtLUeNmb6ANJqF7ip ahrrIHVBYuO0QL/QjclMZQAH9hnpSETrd9CsJAtI/1PD11O1A65zIOpv21jHdffZypth l2sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DvbrLAma; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3-v6si2680125pld.331.2018.07.30.21.29.55; Mon, 30 Jul 2018 21:30:10 -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=@kernel.org header.s=default header.b=DvbrLAma; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727132AbeGaGHZ (ORCPT + 99 others); Tue, 31 Jul 2018 02:07:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:53192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725853AbeGaGHY (ORCPT ); Tue, 31 Jul 2018 02:07:24 -0400 Received: from localhost (unknown [106.200.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3C1D8208A3; Tue, 31 Jul 2018 04:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533011346; bh=s8Lz2etSqfhRf1Ir3gYIpPLraJurKfrRiUr5T6SWFTY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DvbrLAmaLabK9nqqBWtw/gbl1127UNmobn1os8mdE+2BTUX906mNbLZx1mJlN554i qFh2HoJZWH2kSM5irPSJKsOfwPNnLHznjLZWY+gBW8jztmaGsfNXiZ8FVV0TM80JZc rZhYKicsssWTG0ACvy+KJeZR3nGQ1JfchCsNMbl8= Date: Tue, 31 Jul 2018 09:59:03 +0530 From: Vinod To: Peter Ujfalusi Cc: radheys@xilinx.com, vinod.koul@intel.com, lars@metafoo.de, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, appanad@xilinx.com, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC] dmaengine: Add metadat_ops for dma_async_tx_descriptor Message-ID: <20180731042903.GC16775@vkoul-mobl> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-07-18, 12:46, Peter Ujfalusi wrote: > 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. Sounds reasonable... -- ~Vinod