Skip to content

Commit e922bbf

Browse files
kumarama-ivinodkoul
authored andcommitted
dmaengine: idma64: Update bytes_transferred field
Currently when 8250 data transfer is done, bytes_tranferred always returns 0 at /sys/devices/pci0000\:\:**.*/dma/dma*chan*/bytes_transferred. In many cases it gives false impression that data is not being trasferred via DMA. So, updating the bytes_transferred field to count the bytes whenever there is data transfer using idma64. Co-developed-by: Srikanth Thokala <[email protected]> Signed-off-by: Srikanth Thokala <[email protected]> Signed-off-by: Aman Kumar <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8d1b7bd commit e922bbf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/dma/idma64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ static void idma64_chan_irq(struct idma64 *idma64, unsigned short c,
137137
u32 status_err, u32 status_xfer)
138138
{
139139
struct idma64_chan *idma64c = &idma64->chan[c];
140+
struct dma_chan_percpu *stat;
140141
struct idma64_desc *desc;
141142

143+
stat = this_cpu_ptr(idma64c->vchan.chan.local);
144+
142145
spin_lock(&idma64c->vchan.lock);
143146
desc = idma64c->desc;
144147
if (desc) {
@@ -149,6 +152,7 @@ static void idma64_chan_irq(struct idma64 *idma64, unsigned short c,
149152
dma_writel(idma64, CLEAR(XFER), idma64c->mask);
150153
desc->status = DMA_COMPLETE;
151154
vchan_cookie_complete(&desc->vdesc);
155+
stat->bytes_transferred += desc->length;
152156
idma64_start_transfer(idma64c);
153157
}
154158

0 commit comments

Comments
 (0)