All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: fsl-edma: avoid linking both modules
@ 2024-05-28 11:54 Arnd Bergmann
  2024-05-28 15:05 ` Peng Fan
  2024-06-11 18:27 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2024-05-28 11:54 UTC (permalink / raw)
  To: Vinod Koul, Peng Fan, Frank Li
  Cc: Arnd Bergmann, Fabio Estevam, dmaengine, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Kbuild does not support having a source file compiled multiple times
and linked into distinct modules, or built-in and modular at the
same time. For fs-edma, there are two common components that are
linked into the fsl-edma.ko for Arm and PowerPC, plus the mcf-edma.ko
module on Coldfire. This violates the rule for compile-testing:

scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-common.o is added to multiple modules: fsl-edma mcf-edma
scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-trace.o is added to multiple modules: fsl-edma mcf-edma

I tried splitting out the common parts into a separate modules, but
that adds back the complexity that a cleanup patch removed, and it
gets harder with the addition of the tracepoints.

As a minimal workaround, address it at the Kconfig level, by disallowing
the broken configurations.

Link: https://lore.kernel.org/lkml/20240110232255.1099757-1-arnd@kernel.org/
Fixes: 66aac8ea0a6c ("dmaengine: fsl-edma: clean up EXPORT_SYMBOL_GPL in fsl-edma-common.c")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/dma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 965fa49668ff..b3873d01a2ab 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -394,7 +394,7 @@ config LS2X_APB_DMA
 
 config MCF_EDMA
 	tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs"
-	depends on M5441x || COMPILE_TEST
+	depends on M5441x || (COMPILE_TEST && FSL_EDMA=n)
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 	help
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] dmaengine: fsl-edma: avoid linking both modules
  2024-05-28 11:54 [PATCH] dmaengine: fsl-edma: avoid linking both modules Arnd Bergmann
@ 2024-05-28 15:05 ` Peng Fan
  2024-06-11 18:27 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan @ 2024-05-28 15:05 UTC (permalink / raw)
  To: Arnd Bergmann, Vinod Koul, Frank Li
  Cc: Arnd Bergmann, Fabio Estevam, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org

> Subject: [PATCH] dmaengine: fsl-edma: avoid linking both modules
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Kbuild does not support having a source file compiled multiple times and
> linked into distinct modules, or built-in and modular at the same time. For fs-
> edma, there are two common components that are linked into the fsl-
> edma.ko for Arm and PowerPC, plus the mcf-edma.ko module on Coldfire.
> This violates the rule for compile-testing:
>
> scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-common.o is
> added to multiple modules: fsl-edma mcf-edma
> scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-trace.o is added
> to multiple modules: fsl-edma mcf-edma
>
> I tried splitting out the common parts into a separate modules, but that adds
> back the complexity that a cleanup patch removed, and it gets harder with
> the addition of the tracepoints.
>
> As a minimal workaround, address it at the Kconfig level, by disallowing the
> broken configurations.
>
> Link:
> https://lore.ke/
> rnel.org%2Flkml%2F20240110232255.1099757-1-
> arnd%40kernel.org%2F&data=05%7C02%7Cpeng.fan%40nxp.com%7Cfb9b0e
> 6533054fee3d0d08dc7f0cfbe4%7C686ea1d3bc2b4c6fa92cd99c5c301635%7
> C0%7C0%7C638524940949353893%7CUnknown%7CTWFpbGZsb3d8eyJWIj
> oiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0
> %7C%7C%7C&sdata=88jDqMK7okvOsZaMXT02p7coSRTr2r%2FArF1rbAp9P4
> w%3D&reserved=0
> Fixes: 66aac8ea0a6c ("dmaengine: fsl-edma: clean up EXPORT_SYMBOL_GPL
> in fsl-edma-common.c")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/dma/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index
> 965fa49668ff..b3873d01a2ab 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -394,7 +394,7 @@ config LS2X_APB_DMA
>
>  config MCF_EDMA
>       tristate "Freescale eDMA engine support, ColdFire mcf5441x SoCs"
> -     depends on M5441x || COMPILE_TEST
> +     depends on M5441x || (COMPILE_TEST && FSL_EDMA=n)
>       select DMA_ENGINE
>       select DMA_VIRTUAL_CHANNELS
>       help
> --
> 2.39.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dmaengine: fsl-edma: avoid linking both modules
  2024-05-28 11:54 [PATCH] dmaengine: fsl-edma: avoid linking both modules Arnd Bergmann
  2024-05-28 15:05 ` Peng Fan
@ 2024-06-11 18:27 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2024-06-11 18:27 UTC (permalink / raw)
  To: Peng Fan, Frank Li, Arnd Bergmann
  Cc: Arnd Bergmann, Fabio Estevam, dmaengine, linux-kernel


On Tue, 28 May 2024 13:54:22 +0200, Arnd Bergmann wrote:
> Kbuild does not support having a source file compiled multiple times
> and linked into distinct modules, or built-in and modular at the
> same time. For fs-edma, there are two common components that are
> linked into the fsl-edma.ko for Arm and PowerPC, plus the mcf-edma.ko
> module on Coldfire. This violates the rule for compile-testing:
> 
> scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-common.o is added to multiple modules: fsl-edma mcf-edma
> scripts/Makefile.build:236: drivers/dma/Makefile: fsl-edma-trace.o is added to multiple modules: fsl-edma mcf-edma
> 
> [...]

Applied, thanks!

[1/1] dmaengine: fsl-edma: avoid linking both modules
      commit: fa555b5026d0bf1ba7c9e645ff75e2725a982631

Best regards,
-- 
Vinod Koul <vkoul@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-11 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 11:54 [PATCH] dmaengine: fsl-edma: avoid linking both modules Arnd Bergmann
2024-05-28 15:05 ` Peng Fan
2024-06-11 18:27 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.