dmaengine: qcom: bam_dma: Fix completed descriptors count
Subsystems (3)
PATCH 1/1 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
Reported-by Srinivas Kandagatla <[email protected]>
Signed-off-by Sricharan R <[email protected]>
--- drivers/dma/qcom/bam_dma.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/dma/qcom/bam_dma.c +3 -0
@@ -799,6 +799,9 @@ static u32 process_channel_irqs(struct bam_device *bdev)/* Number of bytes available to read */ avail =CIRC_CNT (offset, bchan->head,MAX_DESCRIPTORS +1 ); +if (offset < bchan->head) + avail--; +list_for_each_entry_safe (async_desc, tmp, &bchan->desc_list, desc_node) {/* Not enough data to read */
Signature · 1 line
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Quoted 10 lines · Sricharan R
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/669Reported-by Srinivas Kandagatla <[email protected]>Signed-off-by Sricharan R <[email protected]>
Thanks for the patch, It works for me now!
Tested-by Srinivas Kandagatla <[email protected]>
--srini
Quoted 19 lines
--- drivers/dma/qcom/bam_dma.c | 3 +++ 1 file changed, 3 insertions(+)drivers/dma/qcom/bam_dma.c +3
-0@@ -799,6 +799,9 @@ static u32 process_channel_irqs(struct bam_device *bdev)/* Number of bytes available to read */ avail =CIRC_CNT (offset, bchan->head,MAX_DESCRIPTORS +1 ); +if (offset < bchan->head) + avail--; +list_for_each_entry_safe (async_desc, tmp, &bchan->desc_list, desc_node) {/* Not enough data to read */
Quoted 6 lines · Sricharan R
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
Applied, thanks
Signature · 1 line
~Vinod