dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it
@ 2021-05-18 10:43 Andy Shevchenko
  2021-05-18 10:43 ` [PATCH v1 2/2] dmaengine: hsu: Account transferred bytes Andy Shevchenko
  2021-05-31  4:21 ` [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-05-18 10:43 UTC (permalink / raw)
  To: Andy Shevchenko, Vinod Koul, dmaengine, linux-kernel

We have split by unknown reason of kdoc and struct dma_chan_percpu definition.
Join them back. No functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/dmaengine.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 004736b6a9c8..93c3ca5fdafd 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -229,12 +229,6 @@ enum sum_check_flags {
  */
 typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t;
 
-/**
- * struct dma_chan_percpu - the per-CPU part of struct dma_chan
- * @memcpy_count: transaction counter
- * @bytes_transferred: byte counter
- */
-
 /**
  * enum dma_desc_metadata_mode - per descriptor metadata mode types supported
  * @DESC_METADATA_CLIENT - the metadata buffer is allocated/provided by the
@@ -291,6 +285,11 @@ enum dma_desc_metadata_mode {
 	DESC_METADATA_ENGINE = BIT(1),
 };
 
+/**
+ * struct dma_chan_percpu - the per-CPU part of struct dma_chan
+ * @memcpy_count: transaction counter
+ * @bytes_transferred: byte counter
+ */
 struct dma_chan_percpu {
 	/* stats */
 	unsigned long memcpy_count;
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v1 2/2] dmaengine: hsu: Account transferred bytes
  2021-05-18 10:43 [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Andy Shevchenko
@ 2021-05-18 10:43 ` Andy Shevchenko
  2021-05-31  4:21 ` [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-05-18 10:43 UTC (permalink / raw)
  To: Andy Shevchenko, Vinod Koul, dmaengine, linux-kernel

Bump statistics for transferred bytes at the event of the successful transfer.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/hsu/hsu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c
index 025d8ad5a63c..92caae55aece 100644
--- a/drivers/dma/hsu/hsu.c
+++ b/drivers/dma/hsu/hsu.c
@@ -201,6 +201,7 @@ EXPORT_SYMBOL_GPL(hsu_dma_get_status);
  */
 int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status)
 {
+	struct dma_chan_percpu *stat;
 	struct hsu_dma_chan *hsuc;
 	struct hsu_dma_desc *desc;
 	unsigned long flags;
@@ -210,6 +211,7 @@ int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status)
 		return 0;
 
 	hsuc = &chip->hsu->chan[nr];
+	stat = this_cpu_ptr(hsuc->vchan.chan.local);
 
 	spin_lock_irqsave(&hsuc->vchan.lock, flags);
 	desc = hsuc->desc;
@@ -221,6 +223,7 @@ int hsu_dma_do_irq(struct hsu_dma_chip *chip, unsigned short nr, u32 status)
 		} else {
 			vchan_cookie_complete(&desc->vdesc);
 			desc->status = DMA_COMPLETE;
+			stat->bytes_transferred += desc->length;
 			hsu_dma_start_transfer(hsuc);
 		}
 	}
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it
  2021-05-18 10:43 [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Andy Shevchenko
  2021-05-18 10:43 ` [PATCH v1 2/2] dmaengine: hsu: Account transferred bytes Andy Shevchenko
@ 2021-05-31  4:21 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2021-05-31  4:21 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: dmaengine, linux-kernel

On 18-05-21, 13:43, Andy Shevchenko wrote:
> We have split by unknown reason of kdoc and struct dma_chan_percpu definition.
> Join them back. No functional change.

Applied both, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-31  4:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 10:43 [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Andy Shevchenko
2021-05-18 10:43 ` [PATCH v1 2/2] dmaengine: hsu: Account transferred bytes Andy Shevchenko
2021-05-31  4:21 ` [PATCH v1 1/2] dmaengine: Move kdoc description of struct dma_chan_percpu closer to it Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).