Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2927080ybl; Fri, 20 Dec 2019 00:38:33 -0800 (PST) X-Google-Smtp-Source: APXvYqwQW6r3avEr7O3WhhUEuJc/faCQHcNEOHQdIV3V2eEo62sIMH8paQNlwNOS+W4iznR5zn2Q X-Received: by 2002:a05:6830:4d9:: with SMTP id s25mr13787354otd.171.1576831113828; Fri, 20 Dec 2019 00:38:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576831113; cv=none; d=google.com; s=arc-20160816; b=FfGVcUAhxbHroftOCys0GUZEIqqUFSsULt1hRLsqyo7SVdD0io7yPyL3Ka51/NE6lT AxxWULwmylaVTmSrvF1RMv4clg1KZeoEevPZoKBq8r+WPxWtPE5yT9Vwu2UqTzm7rO9m 8tPomQsZ7nEeSdvIG29zy8qYKqlPHpU61a+LtO4joIwsm66fxGTegtxmlMDqYs0PBBA5 1JeqpZ4K6bK7welZl5+863zm3mWncxeuxfLoSKxe/dbX+tTQqmvkHn2xEpEyifzs5GQa l/qQlQ2hOz8OWocBIFqpFWoX6W/eR9y0pD2gsNT3W7ResFMKbpvdm9p7Qf75UJcSh4rV 2KRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=WoFo7krnPdB/kZjNgXO2cdfVEpQiMFjFfcwYx3mWMw0=; b=ZV5qe8A3ea2MCjtalX+yI8YZZC8J9ejZUh1SWnfe4laAJ7fOI4mr2hvsaNxMfjHeYp xEcu9lAjsQJt386Fq4bgoTM3VWYnUbw4MfeXp2AV6qcsr9MYWcfFK5w3eCZwtdJ6M32l wTxhZq8nOb6Vh48ZCtDhpWBxGFW2U15Fj3A/CBhjTS6WCFL16n7IwUCEgsmRk2xdIkE6 l5QQsplwD7SEnnXXe6EMUR4xyHbSghe4skW3JMTX7jgC0J1tJcHzN+VCDVKopuyez5PC QERmbDEz0IMZRrt8vpHVHeLlYjFKR/WkAlz1WWjaDP1MCSzVKtYHTfa/qoo8VJVANkUE /M9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qs3ZUFjS; 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 q66si4290903oig.65.2019.12.20.00.38.22; Fri, 20 Dec 2019 00:38:33 -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=qs3ZUFjS; 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 S1727434AbfLTIhS (ORCPT + 99 others); Fri, 20 Dec 2019 03:37:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:52214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726651AbfLTIhS (ORCPT ); Fri, 20 Dec 2019 03:37:18 -0500 Received: from localhost (unknown [106.201.107.54]) (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 C4A0A2467F; Fri, 20 Dec 2019 08:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576831037; bh=MwmGwgRhGq+RQ75KDzhynCsOSx4RNN1uA6bAbx7zxGQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qs3ZUFjS2s6IKXqXMNe+xw4oHPJ0ryil98Uvc7u2PQ7Vlev7g9+6xq/DEPvCZFwea itZLuk5mM64Ij3Hn4v4sB/iA3mixlNGx4D0to0STKet4Wcg2U1i/18E8c4/8mqoa1W UX4KFY3+4mNitKcgQe1be5pFxHiy69NyNLkammhQ= Date: Fri, 20 Dec 2019 14:07:13 +0530 From: Vinod Koul To: Peter Ujfalusi Cc: robh+dt@kernel.org, nm@ti.com, ssantosh@kernel.org, dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, grygorii.strashko@ti.com, lokeshvutla@ti.com, t-kristo@ti.com, tony@atomide.com, j-keerthy@ti.com, vigneshr@ti.com Subject: Re: [PATCH v7 05/12] dmaengine: Add support for reporting DMA cached data amount Message-ID: <20191220083713.GL2536@vkoul-mobl> References: <20191209094332.4047-1-peter.ujfalusi@ti.com> <20191209094332.4047-6-peter.ujfalusi@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191209094332.4047-6-peter.ujfalusi@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-12-19, 11:43, Peter Ujfalusi wrote: > A DMA hardware can have big cache or FIFO and the amount of data sitting in > the DMA fabric can be an interest for the clients. > > For example in audio we want to know the delay in the data flow and in case > the DMA have significantly large FIFO/cache, it can affect the latenc/delay > > Signed-off-by: Peter Ujfalusi > Reviewed-by: Tero Kristo > --- > drivers/dma/dmaengine.h | 8 ++++++++ > include/linux/dmaengine.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h > index 501c0b063f85..b0b97475707a 100644 > --- a/drivers/dma/dmaengine.h > +++ b/drivers/dma/dmaengine.h > @@ -77,6 +77,7 @@ static inline enum dma_status dma_cookie_status(struct dma_chan *chan, > state->last = complete; > state->used = used; > state->residue = 0; > + state->in_flight_bytes = 0; > } > return dma_async_is_complete(cookie, complete, used); > } > @@ -87,6 +88,13 @@ static inline void dma_set_residue(struct dma_tx_state *state, u32 residue) > state->residue = residue; > } > > +static inline void dma_set_in_flight_bytes(struct dma_tx_state *state, > + u32 in_flight_bytes) > +{ > + if (state) > + state->in_flight_bytes = in_flight_bytes; > +} This would be used by dmaengine drivers right, so lets move it to drivers/dma/dmaengine.h lets not expose this to users :) -- ~Vinod