Skip to content

Commit f603422

Browse files
Sricharan Rvinodkoul
authored andcommitted
dmaengine: qcom: bam_dma: Fix completed descriptors count
One space is left unused in circular FIFO to differentiate 'full' and 'empty' cases. So take that in to account while counting for the descriptors completed. Fixes the issue reported here, https://lkml.org/lkml/2019/6/18/669 Cc: [email protected] Reported-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Sricharan R <[email protected]> Tested-by: Srinivas Kandagatla <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 3f93a4f commit f603422

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/dma/qcom/bam_dma.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,9 @@ static u32 process_channel_irqs(struct bam_device *bdev)
799799
/* Number of bytes available to read */
800800
avail = CIRC_CNT(offset, bchan->head, MAX_DESCRIPTORS + 1);
801801

802+
if (offset < bchan->head)
803+
avail--;
804+
802805
list_for_each_entry_safe(async_desc, tmp,
803806
&bchan->desc_list, desc_node) {
804807
/* Not enough data to read */

0 commit comments

Comments
 (0)