lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131011133343.GB32689@kroah.com>
Date:	Fri, 11 Oct 2013 06:33:43 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Youquan Song <youquan.song@...el.com>
Cc:	dan.j.williams@...el.com, vinod.koul@...el.com,
	andriy.shevchenko@...el.com, mika.westerberg@...el.com,
	linux-kernel@...r.kernel.org,
	Youquan Song <youquan.song@...ux.intel.com>
Subject: Re: [PATCH 1/2] dma: Add interface to calculate data transferred

On Fri, Oct 11, 2013 at 05:42:17PM -0400, Youquan Song wrote:
> Currently, the DMA channel calculates its data transferred only at network
> device driver. When other devices like UART or SPI etc, transfers data by DMA 
> mode, but it always shows 0 at /sys/class/dma/dma0chan*/bytes_transferred.

Is that really a problem?  I have never heard anyone complaining about
it.  Where are the reports of this?

> This patch add a new function which will calculate how many the data has been
> transferred after doing it by DMA mode. It can be used by other modules and
> also simplify current duplicated code.
> 
> Signed-off-by: Youquan Song <youquan.song@...el.com>
> ---
>  drivers/dma/dmaengine.c   |   35 +++++++++++++++++++----------------
>  include/linux/dmaengine.h |    3 +++
>  2 files changed, 22 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
> index 9162ac8..4356a7e 100644
> --- a/drivers/dma/dmaengine.c
> +++ b/drivers/dma/dmaengine.c
> @@ -901,6 +901,23 @@ void dma_async_device_unregister(struct dma_device *device)
>  }
>  EXPORT_SYMBOL(dma_async_device_unregister);
>  
> +dma_cookie_t
> +dma_tx_submit_cal(struct dma_async_tx_descriptor *tx,
> +		struct dma_chan *chan, size_t len)
> +{
> +
> +	dma_cookie_t cookie;
> +	cookie = tx->tx_submit(tx);
> +
> +	preempt_disable();
> +	__this_cpu_add(chan->local->bytes_transferred, len);
> +	__this_cpu_inc(chan->local->memcpy_count);
> +	preempt_enable();
> +
> +	return cookie;
> +
> +}

You create a function, yet no driver can use it as it's not exported, so
I guess you don't want anyone to use it :)

Anyway, I don't think this is a good idea, see my response to the serial
driver patch for why not.

sorry,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ