Skip to contentSkip to conversation

dmaengine: Move kdoc description of struct dma_chan_percpu closer to it

PATCH Applied Andy Shevchenko 2 participants 3 messages May 18, 2021 – May 31, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dmaengine: Move kdoc description of struct dma_chan_percpu closer to it

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

---
 include/linux/dmaengine.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
include/linux/dmaengine.h +5 -6
index 004736b6a9c8..93c3ca5fdafd 100644
@@ -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;
Signature · 1 line
2.30.2
#1 lore raw

PATCH 2/2 dmaengine: hsu: Account transferred bytes

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

---
 drivers/dma/hsu/hsu.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma/hsu/hsu.c +3 -0
index 025d8ad5a63c..92caae55aece 100644
@@ -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);
 		}
 	}
Signature · 1 line
2.30.2
maintainer Applied
#2 lore raw
In reply to Andy Shevchenko
Quoted 2 lines · Andy Shevchenko

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

Applied both, thanks

Signature · 1 line
~Vinod