public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency
@ 2025-03-29 16:41 Arnd Bergmann
  2025-03-29 16:50 ` Wolfram Sang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2025-03-29 16:41 UTC (permalink / raw)
  To: Ulf Hansson, Biju Das, Wolfram Sang
  Cc: Arnd Bergmann, Adrian Hunter, Geert Uytterhoeven, linux-mmc,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The driver started using the regulator subsystem and fails to build without
a dependeny on CONFIG_REGULATOR:

ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!

The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
in order to avoid Kconfig dependency loops here. It also turns out the the superh
version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
CONFIG_OF is not set there.

Change both to a 'depends on', but add '|| OF' for the superh case.

Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/mmc/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index c3a9e856053b..c9e067b5ba94 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -694,8 +694,8 @@ config MMC_TMIO_CORE
 config MMC_SDHI
 	tristate "Renesas SDHI SD/SDIO controller support"
 	depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
+	depends on (RESET_CONTROLLER && REGULATOR) || !OF
 	select MMC_TMIO_CORE
-	select RESET_CONTROLLER if ARCH_RENESAS
 	help
 	  This provides support for the SDHI SD/SDIO controller found in
 	  Renesas SuperH, ARM and ARM64 based SoCs
-- 
2.39.5


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

* Re: [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency
  2025-03-29 16:41 [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency Arnd Bergmann
@ 2025-03-29 16:50 ` Wolfram Sang
  2025-03-31  9:37 ` Geert Uytterhoeven
  2025-04-07 16:04 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2025-03-29 16:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ulf Hansson, Biju Das, Arnd Bergmann, Adrian Hunter,
	Geert Uytterhoeven, linux-mmc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

On Sat, Mar 29, 2025 at 05:41:26PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The driver started using the regulator subsystem and fails to build without
> a dependeny on CONFIG_REGULATOR:
> 
> ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
> ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
> 
> The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
> in order to avoid Kconfig dependency loops here. It also turns out the the superh
> version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
> CONFIG_OF is not set there.
> 
> Change both to a 'depends on', but add '|| OF' for the superh case.

!OF

> Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Other than that:

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thank you!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency
  2025-03-29 16:41 [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency Arnd Bergmann
  2025-03-29 16:50 ` Wolfram Sang
@ 2025-03-31  9:37 ` Geert Uytterhoeven
  2025-04-07 16:04 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2025-03-31  9:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Ulf Hansson, Biju Das, Wolfram Sang, Arnd Bergmann, Adrian Hunter,
	Geert Uytterhoeven, linux-mmc, linux-kernel

Hi Arnd,

On Sat, 29 Mar 2025 at 17:41, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The driver started using the regulator subsystem and fails to build without
> a dependeny on CONFIG_REGULATOR:
>
> ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
> ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
>
> The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
> in order to avoid Kconfig dependency loops here. It also turns out the the superh
> version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
> CONFIG_OF is not set there.

Both the reset controller and regulator are needed only on a subset
of the supported SoCs.  However, unlike the reset subsystem, the
regulator subsystem does not provide dummies when disabled.

Fortunately most regulator code in the SDHI driver is optimized away
by the compiler when CONFIG_OF is not enabled, and the remaining call
to mmc_regulator_set_vqmmc() is harmless, as the MMC core does provide
a dummy in case regulator support is disabled.

So e.g. an sh7724_generic_defconfig + CONFIG_MMC + CONFIG_MMC_SDHI +
CONFIG_OF build indeed failed because of missing regulator symbols.

Note that it is a bit strange sh7724_generic_defconfig and
ecovec24_defconfig do not enable regulator support, as
arch/sh/boards/mach-ecovec24/setup.c does contain regulators.

> Change both to a 'depends on', but add '|| OF' for the superh case.
>
> Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

With the typo pointed out by Wolfram fixed:
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency
  2025-03-29 16:41 [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency Arnd Bergmann
  2025-03-29 16:50 ` Wolfram Sang
  2025-03-31  9:37 ` Geert Uytterhoeven
@ 2025-04-07 16:04 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2025-04-07 16:04 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Biju Das, Wolfram Sang, Arnd Bergmann, Adrian Hunter,
	Geert Uytterhoeven, linux-mmc, linux-kernel

On Sat, 29 Mar 2025 at 17:41, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The driver started using the regulator subsystem and fails to build without
> a dependeny on CONFIG_REGULATOR:
>
> ERROR: modpost: "rdev_get_drvdata" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
> ERROR: modpost: "devm_regulator_register" [drivers/mmc/host/renesas_sdhi_core.ko] undefined!
>
> The 'select RESET_CONTROLLER' needs to either go away or get changed to a dependency
> in order to avoid Kconfig dependency loops here. It also turns out the the superh
> version needs neither RESET_CONTROLLER nor REGULATOR, and this works because
> CONFIG_OF is not set there.
>
> Change both to a 'depends on', but add '|| OF' for the superh case.
>
> Fixes: fae80a99dc03 ("mmc: renesas_sdhi: Add support for RZ/G3E SoC")
> Tested-by: Biju Das <biju.das.jz@bp.renesas.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied for fixes and by fixing the typo pointed out by Geert, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index c3a9e856053b..c9e067b5ba94 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -694,8 +694,8 @@ config MMC_TMIO_CORE
>  config MMC_SDHI
>         tristate "Renesas SDHI SD/SDIO controller support"
>         depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
> +       depends on (RESET_CONTROLLER && REGULATOR) || !OF
>         select MMC_TMIO_CORE
> -       select RESET_CONTROLLER if ARCH_RENESAS
>         help
>           This provides support for the SDHI SD/SDIO controller found in
>           Renesas SuperH, ARM and ARM64 based SoCs
> --
> 2.39.5
>

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

end of thread, other threads:[~2025-04-07 16:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-29 16:41 [PATCH] [v2] mmc: renesas_sdhi: add regulator dependency Arnd Bergmann
2025-03-29 16:50 ` Wolfram Sang
2025-03-31  9:37 ` Geert Uytterhoeven
2025-04-07 16:04 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox