[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d86b1c3b-19bc-6c51-a364-c46ca019db1a@codeaurora.org>
Date:   Wed, 19 Jun 2019 23:20:05 +0530
From:   Sricharan R <sricharan@...eaurora.org>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        vkoul@...nel.org
Cc:     dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH] dmaengine: qcom-bam: fix circular buffer handling
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
Powered by blists - more mailing lists
 
