Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp1488944ima; Sat, 2 Feb 2019 01:37:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6TKbmoqMOJPQcXYg3Ylq1IIPlZkK2WFWqfUeZLJYj53/Qm2LY0ksTFAPOlDwTEvRUL9YHg X-Received: by 2002:a62:3006:: with SMTP id w6mr43383942pfw.258.1549100255332; Sat, 02 Feb 2019 01:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549100255; cv=none; d=google.com; s=arc-20160816; b=WWHvhMMf9ncePDRNdpo7/YXulx0x8rkLqjDNPc8uus7E7nELm3j+T2mmHkHZHLsQi4 2KObpDdhcKE1QUuEOiDP6l+sHi/omRqpMW7dlceb9zd5uusweNzskBCTjfznnSyXrER+ z43gE+fMTsIOQGZbLNe0tvUMZu/99z/5P5w5WXLTPPaLxyocTsJcdptmCWm9qI4PCsRe Vitlzi1PSBTY26qiM9PrYDtqP4nXY/DLOgP8fEu+kABPSTIpvpdpbcqoDvvh9iFrqTGs rFUuve6b1KPPj8vcbiD88gIKRrnVI5eOf0XRzI0tgyCJ6b1mEfM1w9Fpm4AjLCofgwWL GzRw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oQO8b7EqdRU7Poipuml91xlZoBDxE8RQZ2lTKNiJng4=; b=Abg30ZcDxYJnumwIVLsDodrQyGgEbeisbeOU6i10bUhZvAmJIRVCuu7YMdFjXA33wh eHxMOyoZApWIQpJ44pJjkLX1utctixcy808D3m7Bn1xig8+MIbSbuYO2JM1KsLBZmQ5F iITwch92a1dWB/IHnG5knqgCZemcGsVt8hopvRfqGr6PymkjmwqH3G+lGeK7RbmVkr6u 20wcXoSvfepAfPYHJCzHP0H8GG/bWZfCMons0VelDWVHKqlnnLF6RJ9PIO2DP21zBg+N D8jvA13CNz7i0iLc9givDOv/znRspbbNHZr2y1/zHq13iYuC3fgsFULnGAfF1EsjxUvH gxaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NIKBiQJC; 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 l123si10227100pfc.187.2019.02.02.01.37.19; Sat, 02 Feb 2019 01:37:35 -0800 (PST) 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=NIKBiQJC; 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 S1726971AbfBBJhP (ORCPT + 99 others); Sat, 2 Feb 2019 04:37:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:40534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfBBJhO (ORCPT ); Sat, 2 Feb 2019 04:37:14 -0500 Received: from localhost (unknown [125.16.100.118]) (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 5373720870; Sat, 2 Feb 2019 09:37:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549100234; bh=UsFfb+3BH4+0XTBnl8zNtli9MDcvDqpzNijtUOXfqAg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NIKBiQJCwY+hT99SMRtJJuZkWBqs3MQ8Gyhc58wY9iCDp6GflyFa9fQmCdt6OEJ+a FFHUGudbzzF911Oxf0tS4U7zGwHGFZYuS5hvhxcyAuhVnT1ioahYZd2bXcKGIW2ef3 lZxQFtRLU9/RaA3Oh5ShtbCB40+xVaadoK2BTlUk= Date: Sat, 2 Feb 2019 15:05:43 +0530 From: Vinod Koul To: Federico Vaga Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: DMA Engine Documentation: TX Descriptor and Submission Message-ID: <20190202093226.GC4296@vkoul-mobl> References: <1655406.8MLMLfCWyH@pcbe13614> <20190201041750.GM4635@vkoul-mobl> <77C59695-001C-46B3-9C41-C4C7A763D001@cern.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <77C59695-001C-46B3-9C41-C4C7A763D001@cern.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01-02-19, 09:59, Federico Vaga wrote: > > > On February 1, 2019 4:17:50 AM UTC, Vinod Koul wrote: > >On 28-01-19, 09:47, Federico Vaga wrote: > >> Hi, > >> > >> I have a new question concerning documentation. > >> > >> > >https://www.kernel.org/doc/html/latest/driver-api/dmaengine/client.html > >> > >> >From this document it is not really clear, at least to me, if > >clients can > >> consider valid the `struct dma_async_tx_descriptor` after submission > >to the > >> DMA engine. > > > >Nope they can't and should not touch the descriptor after submission. > >The client get cookie and that is supposed to be used > > Good, thanks > > > >> > >> Clients get a TX descriptor from a DMA engine using things like > >> `dmaengine_prep_*`. These calls - may - allocate new descriptors and > >return > >> them to the caller; this may include other structures which are not > >visible to > >> clients. So, if my understanding is correct, this means that it's the > >DMA > >> engine that, on TX completion, releases any TX descriptor allocated > >by > >> `dmaengine_prep_*`. This implies that the pointer that the client is > >using > >> must be considered invalid right after `dmaengine_submit()`. > >> If what I understood by reading the documentation and the code is > >correct, > >> then I think that this should be mentioned in the Documentation. > >> If I'm wrong, please tell me where :) > > > >And what exactly are you trying to do here..? > Please wrap your replies within 80chars > What if I answer: "the right thing"? Joking. I just expressed my > understanding of something which is not documented properly (my > opinion). I wanted to be sure that the logic, the reasons behind are > the ones that I understood. I will propose a patch to the > documentation, unless you want to do it. -- Inviato dal mio > dispositivo Android con K-9 Mail. Perdonate la brevit?. Sure please feel free to send a patch :) Mostly people ask these questions based on a driver they are working off, and it makes sense to fix the assumptions by asking what they are trying to achieve... -- ~Vinod