mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
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: stable@vger.kernel.org Reported-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
3f93a4f297
commit
f603422544
1 changed files with 3 additions and 0 deletions
|
@ -799,6 +799,9 @@ static u32 process_channel_irqs(struct bam_device *bdev)
|
||||||
/* Number of bytes available to read */
|
/* Number of bytes available to read */
|
||||||
avail = CIRC_CNT(offset, bchan->head, MAX_DESCRIPTORS + 1);
|
avail = CIRC_CNT(offset, bchan->head, MAX_DESCRIPTORS + 1);
|
||||||
|
|
||||||
|
if (offset < bchan->head)
|
||||||
|
avail--;
|
||||||
|
|
||||||
list_for_each_entry_safe(async_desc, tmp,
|
list_for_each_entry_safe(async_desc, tmp,
|
||||||
&bchan->desc_list, desc_node) {
|
&bchan->desc_list, desc_node) {
|
||||||
/* Not enough data to read */
|
/* Not enough data to read */
|
||||||
|
|
Loading…
Reference in a new issue