From: "Shevchenko, Andriy" <andriy.shevchenko@intel.com>
To: "Song, Youquan" <youquan.song@intel.com>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>,
"Koul, Vinod" <vinod.koul@intel.com>,
"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"Westerberg, Mika" <mika.westerberg@intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Youquan Song <youquan.song@linux.intel.com>
Subject: Re: [PATCH 1/2] dma: Add interface to calculate data transferred
Date: Fri, 11 Oct 2013 10:22:15 +0000 [thread overview]
Message-ID: <1381486917.29062.107.camel@smile> (raw)
In-Reply-To: <1381527738-9339-2-git-send-email-youquan.song@intel.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2204 bytes --]
On Fri, 2013-10-11 at 17:42 -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.
>
> 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.
Thanks for the patch. My comments below.
First of all, what is the point to have every device driver that uses
DMA to increment bytes_transferred value? It will show just amount of
data transferred through certain channel. How it could be used then?
> --- 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)
I think there is a better name for the function.
dmaengine_submit_and_count() for example?
> +{
> +
> + dma_cookie_t cookie;
Above lines probably have to be exchanged.
> + cookie = tx->tx_submit(tx);
And you may incorporate this line into above.
> +
> + preempt_disable();
> + __this_cpu_add(chan->local->bytes_transferred, len);
> + __this_cpu_inc(chan->local->memcpy_count);
> + preempt_enable();
> +
> + return cookie;
> +
Redundant empty line.
> +}
--
Andy Shevchenko <andriy.shevchenko@intel.com>
Intel Finland Oy
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
next prev parent reply other threads:[~2013-10-11 10:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 21:42 DMA: Calculate how many data transferred by DMA Youquan Song
2013-10-11 21:42 ` [PATCH 1/2] dma: Add interface to calculate data transferred Youquan Song
2013-10-11 10:22 ` Shevchenko, Andriy [this message]
2013-10-11 13:33 ` Greg KH
2013-10-13 15:26 ` Vinod Koul
2013-10-15 18:31 ` Youquan Song
2013-10-15 15:30 ` Greg KH
2013-10-15 15:55 ` Dan Williams
2013-10-15 16:17 ` Greg KH
2013-10-16 5:38 ` Vinod Koul
2013-10-16 8:36 ` Shevchenko, Andriy
2013-10-16 7:57 ` Vinod Koul
2013-10-16 9:13 ` Shevchenko, Andriy
2013-10-16 14:12 ` Greg KH
2013-10-16 15:07 ` Vinod Koul
2013-10-16 18:17 ` Dan Williams
2013-10-11 21:42 ` [PATCH 2/2] dma: calculate the data tranferred by 8250 Youquan Song
2013-10-11 13:32 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381486917.29062.107.camel@smile \
--to=andriy.shevchenko@intel.com \
--cc=dan.j.williams@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@intel.com \
--cc=vinod.koul@intel.com \
--cc=youquan.song@intel.com \
--cc=youquan.song@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox