From: Sricharan R <sricharan@codeaurora.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>, vkoul@kernel.org
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] dmaengine: qcom-bam: fix circular buffer handling
Date: Wed, 19 Jun 2019 23:20:05 +0530 [thread overview]
Message-ID: <d86b1c3b-19bc-6c51-a364-c46ca019db1a@codeaurora.org> (raw)
In-Reply-To: <31574ef2-d675-bb36-08d1-18b756ebd29e@linaro.org>
Hi Srini,
On 6/18/2019 10:20 PM, Srinivas Kandagatla wrote:
>
>
> On 18/06/2019 17:27, Sricharan R wrote:
>> The Macro's expect that buffer size is power of 2. So we are infact passing the actual correct
>> size ( MAX_DESCRIPTORS + 1 = 4096)
> This will make the circular buffer macros happy but question is that do we actually have that many descriptor buffers?
>
> This is what is in the driver:
>
> #define BAM_DESC_FIFO_SIZE SZ_32K
> #define MAX_DESCRIPTORS (BAM_DESC_FIFO_SIZE / sizeof(struct bam_desc_hw) - 1)
> #define BAM_FIFO_SIZE (SZ_32K - 8)
>
> Wouldn't having MAX_DESCRIPTORS + 1 = 4096 lead to overflow the actual descriptor memory size of (SZ_32K - 8) ?
>
Right, but the CIRC_SPACE macro assumes there is 1 space less than the actual size.
That said, agree there is an issue on the boundary. I will also do some testing tomorrow
on this and get back.
Regards,
Sricharan
--
"QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
prev parent reply other threads:[~2019-06-19 17:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 14:20 [PATCH] dmaengine: qcom-bam: fix circular buffer handling Srinivas Kandagatla
2019-06-14 19:43 ` Andy Gross
2019-06-18 4:53 ` Vinod Koul
2019-06-18 7:13 ` Sricharan R
2019-06-18 14:49 ` Srinivas Kandagatla
2019-06-18 14:50 ` Srinivas Kandagatla
2019-06-18 14:56 ` Sricharan R
2019-06-18 15:12 ` Srinivas Kandagatla
2019-06-18 16:27 ` Sricharan R
2019-06-18 16:50 ` Srinivas Kandagatla
2019-06-19 17:50 ` Sricharan R [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d86b1c3b-19bc-6c51-a364-c46ca019db1a@codeaurora.org \
--to=sricharan@codeaurora.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srinivas.kandagatla@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).