* [PATCH 1/1] dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit
@ 2022-05-10 16:31 Ruiqi Li
2022-05-12 10:39 ` Serge Semin
0 siblings, 1 reply; 2+ messages in thread
From: Ruiqi Li @ 2022-05-10 16:31 UTC (permalink / raw)
To: gustavo.pimentel, vkoul, dmaengine, linux-kernel; +Cc: Ruiqi Li
Commit at 8fc5133d fixed unaligned memory access, which caused both 32
and 64 bit to be the same.
#ifdef CONFIG_64BIT
/* llp is not aligned on 64bit -> keep 32bit accesses */
SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
lower_32_bits(chunk->ll_region.paddr));
SET_CH_32(dw, chan->dir, chan->id, llp.msb,
upper_32_bits(chunk->ll_region.paddr));
#else /* CONFIG_64BIT */
SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
lower_32_bits(chunk->ll_region.paddr));
SET_CH_32(dw, chan->dir, chan->id, llp.msb,
upper_32_bits(chunk->ll_region.paddr));
#endif /* CONFIG_64BIT */
This patch removes redundant preprocessor check for 64 bit.
Signed-off-by: Ruiqi Li <guywithanaxe42@gmail.com>
---
drivers/dma/dw-edma/dw-edma-v0-core.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c
index 33bc1e6c4cf2..d34f344a094b 100644
--- a/drivers/dma/dw-edma/dw-edma-v0-core.c
+++ b/drivers/dma/dw-edma/dw-edma-v0-core.c
@@ -415,18 +415,11 @@ void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
(DW_EDMA_V0_CCS | DW_EDMA_V0_LLE));
/* Linked list */
- #ifdef CONFIG_64BIT
/* llp is not aligned on 64bit -> keep 32bit accesses */
SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
lower_32_bits(chunk->ll_region.paddr));
SET_CH_32(dw, chan->dir, chan->id, llp.msb,
upper_32_bits(chunk->ll_region.paddr));
- #else /* CONFIG_64BIT */
- SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
- lower_32_bits(chunk->ll_region.paddr));
- SET_CH_32(dw, chan->dir, chan->id, llp.msb,
- upper_32_bits(chunk->ll_region.paddr));
- #endif /* CONFIG_64BIT */
}
/* Doorbell */
SET_RW_32(dw, chan->dir, doorbell,
--
2.36.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit
2022-05-10 16:31 [PATCH 1/1] dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit Ruiqi Li
@ 2022-05-12 10:39 ` Serge Semin
0 siblings, 0 replies; 2+ messages in thread
From: Serge Semin @ 2022-05-12 10:39 UTC (permalink / raw)
To: Ruiqi Li; +Cc: Serge Semin, gustavo.pimentel, vkoul, dmaengine, linux-kernel
Hello Ruiqu
On Tue, May 10, 2022 at 11:31:17AM -0500, Ruiqi Li wrote:
> Commit at 8fc5133d fixed unaligned memory access, which caused both 32
> and 64 bit to be the same.
>
> #ifdef CONFIG_64BIT
> /* llp is not aligned on 64bit -> keep 32bit accesses */
> SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
> lower_32_bits(chunk->ll_region.paddr));
> SET_CH_32(dw, chan->dir, chan->id, llp.msb,
> upper_32_bits(chunk->ll_region.paddr));
> #else /* CONFIG_64BIT */
> SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
> lower_32_bits(chunk->ll_region.paddr));
> SET_CH_32(dw, chan->dir, chan->id, llp.msb,
> upper_32_bits(chunk->ll_region.paddr));
> #endif /* CONFIG_64BIT */
>
> This patch removes redundant preprocessor check for 64 bit.
A similar fix but with another reasoning has already been submitted:
Link: https://lore.kernel.org/linux-pci/20220503225104.12108-21-Sergey.Semin@baikalelectronics.ru/
So not only the denoted but all 64BIT-ifdef's will be dropped from the
driver.
-Sergey
>
> Signed-off-by: Ruiqi Li <guywithanaxe42@gmail.com>
> ---
> drivers/dma/dw-edma/dw-edma-v0-core.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c
> index 33bc1e6c4cf2..d34f344a094b 100644
> --- a/drivers/dma/dw-edma/dw-edma-v0-core.c
> +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c
> @@ -415,18 +415,11 @@ void dw_edma_v0_core_start(struct dw_edma_chunk *chunk, bool first)
> (DW_EDMA_V0_CCS | DW_EDMA_V0_LLE));
> /* Linked list */
>
> - #ifdef CONFIG_64BIT
> /* llp is not aligned on 64bit -> keep 32bit accesses */
> SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
> lower_32_bits(chunk->ll_region.paddr));
> SET_CH_32(dw, chan->dir, chan->id, llp.msb,
> upper_32_bits(chunk->ll_region.paddr));
> - #else /* CONFIG_64BIT */
> - SET_CH_32(dw, chan->dir, chan->id, llp.lsb,
> - lower_32_bits(chunk->ll_region.paddr));
> - SET_CH_32(dw, chan->dir, chan->id, llp.msb,
> - upper_32_bits(chunk->ll_region.paddr));
> - #endif /* CONFIG_64BIT */
> }
> /* Doorbell */
> SET_RW_32(dw, chan->dir, doorbell,
> --
> 2.36.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-12 10:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-10 16:31 [PATCH 1/1] dmaengine: dw-edma: Removed redundant #ifdef check for 64-bit Ruiqi Li
2022-05-12 10:39 ` Serge Semin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox