From: Pierre Yves MORDRET <pierre-yves.mordret@st.com>
To: Robin Murphy <robin.murphy@arm.com>,
Vinod Koul <vinod.koul@intel.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Dan Williams <dan.j.williams@intel.com>,
"M'boumba Cedric Madianga" <cedric.madianga@gmail.com>,
<dmaengine@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] dmaengine: stm32-mdma: align TLEN and buffer length on burst
Date: Fri, 13 Apr 2018 11:45:44 +0200 [thread overview]
Message-ID: <22bd0af7-9820-57c5-9215-8185839d7d27@st.com> (raw)
In-Reply-To: <9a2a267c-2b0b-0d6a-c762-47e7d37f84ea@arm.com>
Hi Robin
On 04/11/2018 05:14 PM, Robin Murphy wrote:
> On 11/04/18 15:44, Pierre-Yves MORDRET wrote:
>> Both buffer Transfer Length (TLEN if any) and transfer size have to be
>> aligned on burst size (burst beats*bus width).
>>
>> Signed-off-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
>> ---
>> Version history:
>> v1:
>> * Initial
>> v2:
>> ---
>> ---
>> drivers/dma/stm32-mdma.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
>> index daa1602..fbcffa2 100644
>> --- a/drivers/dma/stm32-mdma.c
>> +++ b/drivers/dma/stm32-mdma.c
>> @@ -413,7 +413,7 @@ static u32 stm32_mdma_get_best_burst(u32 buf_len, u32 tlen, u32 max_burst,
>> u32 best_burst = max_burst;
>> u32 burst_len = best_burst * width;
>>
>> - while ((burst_len > 0) && (tlen % burst_len)) {
>> + while ((burst_len > 0) && (((tlen | buf_len) & (burst_len - 1)) != 0)) {
>> best_burst = best_burst >> 1;
>> burst_len = best_burst * width;
>> }
>
> FWIW, doesn't that whole loop come down to just:
>
> burst_len = min(ffs(tlen | buf_len), max_burst * width);
No sure it ends as expected. or I miss something or don't understand this statement
I tried with "relevant value" : i.e. best_burst = 32, Tlen=128(default) and
buf_len = 64, width= 4. This statements gets me something wrong output => 7
instead of 16 * 4.
I doubt :)
>
> ?
>
> Robin.
>
next prev parent reply other threads:[~2018-04-13 9:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-11 14:44 [PATCH v2 0/2] Append some fixes and improvements Pierre-Yves MORDRET
2018-04-11 14:44 ` [PATCH v2 1/2] dmaengine: stm32-mdma: align TLEN and buffer length on burst Pierre-Yves MORDRET
2018-04-11 15:14 ` Robin Murphy
2018-04-13 9:45 ` Pierre Yves MORDRET [this message]
2018-04-13 11:09 ` Robin Murphy
2018-04-13 12:30 ` Pierre Yves MORDRET
2018-04-11 14:44 ` [PATCH v2 2/2] dmaengine: stm32-mdma: Fix incomplete Hw descriptors allocator Pierre-Yves MORDRET
2018-04-13 4:02 ` Vinod Koul
2018-04-13 8:39 ` Geert Uytterhoeven
2018-04-13 10:09 ` Vinod Koul
2018-04-13 10:40 ` Geert Uytterhoeven
2018-04-13 11:48 ` Robin Murphy
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=22bd0af7-9820-57c5-9215-8185839d7d27@st.com \
--to=pierre-yves.mordret@st.com \
--cc=alexandre.torgue@st.com \
--cc=cedric.madianga@gmail.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=robin.murphy@arm.com \
--cc=vinod.koul@intel.com \
/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).