dmaengine Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count
@ 2019-06-28 12:09 Sricharan R
  2019-06-28 12:26 ` Srinivas Kandagatla
  2019-07-05  7:49 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Sricharan R @ 2019-06-28 12:09 UTC (permalink / raw)
  To: agross, david.brown, dan.j.williams, vkoul, linux-arm-msm,
	dmaengine, linux-kernel, srinivas.kandagatla
  Cc: stable, sricharan

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>
---
 drivers/dma/qcom/bam_dma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 4b43844..8e90a40 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -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 */
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count
  2019-06-28 12:09 [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count Sricharan R
@ 2019-06-28 12:26 ` Srinivas Kandagatla
  2019-07-05  7:49 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2019-06-28 12:26 UTC (permalink / raw)
  To: Sricharan R, agross, david.brown, dan.j.williams, vkoul,
	linux-arm-msm, dmaengine, linux-kernel
  Cc: stable



On 28/06/2019 13:09, Sricharan R wrote:
> 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>

Thanks for the patch, It works for me now!

Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

--srini

> ---
>   drivers/dma/qcom/bam_dma.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
> index 4b43844..8e90a40 100644
> --- a/drivers/dma/qcom/bam_dma.c
> +++ b/drivers/dma/qcom/bam_dma.c
> @@ -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 */
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count
  2019-06-28 12:09 [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count Sricharan R
  2019-06-28 12:26 ` Srinivas Kandagatla
@ 2019-07-05  7:49 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2019-07-05  7:49 UTC (permalink / raw)
  To: Sricharan R
  Cc: agross, david.brown, dan.j.williams, linux-arm-msm, dmaengine,
	linux-kernel, srinivas.kandagatla, stable

On 28-06-19, 17:39, Sricharan R wrote:
> 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

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 12:09 [PATCH] dmaengine: qcom: bam_dma: Fix completed descriptors count Sricharan R
2019-06-28 12:26 ` Srinivas Kandagatla
2019-07-05  7:49 ` Vinod Koul

dmaengine Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dmaengine/0 dmaengine/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dmaengine dmaengine/ https://lore.kernel.org/dmaengine \
		dmaengine@vger.kernel.org
	public-inbox-index dmaengine

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dmaengine


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git