[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YYoMM5RnQ+G7RtFw@matsya>
Date: Tue, 9 Nov 2021 11:20:43 +0530
From: Vinod Koul <vkoul@...nel.org>
To: Amelie Delaunay <amelie.delaunay@...s.st.com>
Cc: Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
dmaengine@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH 1/1] dmaengine: stm32-dma: avoid 64-bit division in
stm32_dma_get_max_width
On 03-11-21, 16:33, Amelie Delaunay wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> Using the % operator on a 64-bit variable is expensive and can
> cause a link failure:
>
> arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_get_max_width':
> stm32-dma.c:(.text+0x170): undefined reference to `__aeabi_uldivmod'
> arm-linux-gnueabi-ld: drivers/dma/stm32-dma.o: in function `stm32_dma_set_xfer_param':
> stm32-dma.c:(.text+0x1cd4): undefined reference to `__aeabi_uldivmod'
>
> As we know that we just want to check the alignment in
> stm32_dma_get_max_width(), there is no need for a full division, and
> using a simple mask is a faster replacement.
>
> Same in stm32_dma_set_xfer_param(), change this to only allow burst
> transfers if the address is a multiple of the length.
> stm32_dma_get_best_burst just after will take buf_len into account to fix
> burst in case of misalignment.
Applied, thanks
--
~Vinod
Powered by blists - more mailing lists