diff mbox series

[v2] pinctrl: spacemit: enable config option

Message ID 20250212-k1-pinctrl-option-v2-1-bde7da0bc0d9@gentoo.org (mailing list archive)
State Superseded
Headers show
Series [v2] pinctrl: spacemit: enable config option | expand

Checks

Context Check Description
bjorn/pre-ci_am success Success
bjorn/build-rv32-defconfig success build-rv32-defconfig
bjorn/build-rv64-clang-allmodconfig success build-rv64-clang-allmodconfig
bjorn/build-rv64-gcc-allmodconfig success build-rv64-gcc-allmodconfig
bjorn/build-rv64-nommu-k210-defconfig success build-rv64-nommu-k210-defconfig
bjorn/build-rv64-nommu-k210-virt success build-rv64-nommu-k210-virt
bjorn/checkpatch warning checkpatch
bjorn/dtb-warn-rv64 success dtb-warn-rv64
bjorn/header-inline success header-inline
bjorn/kdoc success kdoc
bjorn/module-param success module-param
bjorn/verify-fixes success verify-fixes
bjorn/verify-signedoff success verify-signedoff

Commit Message

Yixun Lan Feb. 12, 2025, 8:27 a.m. UTC
Pinctrl is an essential driver for SpacemiT's SoC,
so let's enable it by default for this SoC.

The CONFIG_PINCTRL_SPACEMIT_K1 isn't enabled when using
'make defconfig' to select kernel configuration options.
This result in a broken uart driver where fail at probe()
stage due to no pins found.

Fixes: a83c29e1d145 ("pinctrl: spacemit: add support for SpacemiT K1 SoC")
Reported-by: Alex Elder <elder@kernel.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Tested-by: Alex Elder <elder@riscstar.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
This should fix problem that CONFIG_PINCTRL_SPACEMIT_K1 is not enabled
when using make defconfig, thus fail to initilize uart driver which requst
pins during probe stage.
---
Changes in v2:
- set default as y
- Link to v1: https://lore.kernel.org/r/20250207-k1-pinctrl-option-v1-1-e8a7e4d8404f@gentoo.org
---
 arch/riscv/Kconfig.socs          | 1 +
 drivers/pinctrl/spacemit/Kconfig | 1 +
 2 files changed, 2 insertions(+)


---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250207-k1-pinctrl-option-de5bdfd6b42e

Best regards,

Comments

Alex Elder Feb. 12, 2025, 1:50 p.m. UTC | #1
On 2/12/25 2:27 AM, Yixun Lan wrote:
> Pinctrl is an essential driver for SpacemiT's SoC,
> so let's enable it by default for this SoC.
> 
> The CONFIG_PINCTRL_SPACEMIT_K1 isn't enabled when using
> 'make defconfig' to select kernel configuration options.
> This result in a broken uart driver where fail at probe()
> stage due to no pins found.
> 
> Fixes: a83c29e1d145 ("pinctrl: spacemit: add support for SpacemiT K1 SoC")
> Reported-by: Alex Elder <elder@kernel.org>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>
> Tested-by: Alex Elder <elder@riscstar.com>
> Signed-off-by: Yixun Lan <dlan@gentoo.org>

I just tested this version of the patch.  By default
PINCTRL_SPACEMIT_K1 is "y".  But since it's tristate,
perhaps it should be default=m so it's not built in
for everyone.  Yixun I assume the K1 pinctrl driver
actually *works* as a kernel module.

Anyway, I suggest this change to be a module; Conor
should weigh in.  Either way is good for me, and I
have tested both.

Reviewed-by: Alex Elder <elder@riscstar.com>

> ---
> This should fix problem that CONFIG_PINCTRL_SPACEMIT_K1 is not enabled
> when using make defconfig, thus fail to initilize uart driver which requst
> pins during probe stage.
> ---
> Changes in v2:
> - set default as y
> - Link to v1: https://lore.kernel.org/r/20250207-k1-pinctrl-option-v1-1-e8a7e4d8404f@gentoo.org
> ---
>   arch/riscv/Kconfig.socs          | 1 +
>   drivers/pinctrl/spacemit/Kconfig | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> index 1916cf7ba450ec9958265de2ca41dc504d4d2f7c..17606940bb5239d0fdfc6b5aefb50eeb982d14aa 100644
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -26,6 +26,7 @@ config ARCH_SOPHGO
>   
>   config ARCH_SPACEMIT
>   	bool "SpacemiT SoCs"
> +	select PINCTRL
>   	help
>   	  This enables support for SpacemiT SoC platform hardware.
>   
> diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig
> index 168f8a5ffbb952cbeae3e3401c11149558e0a84b..c18d879274e72df251e0bc82a308603ce23738bd 100644
> --- a/drivers/pinctrl/spacemit/Kconfig
> +++ b/drivers/pinctrl/spacemit/Kconfig
> @@ -7,6 +7,7 @@ config PINCTRL_SPACEMIT_K1
>   	tristate "SpacemiT K1 SoC Pinctrl driver"
>   	depends on ARCH_SPACEMIT || COMPILE_TEST
>   	depends on OF
> +	default y
>   	select GENERIC_PINCTRL_GROUPS
>   	select GENERIC_PINMUX_FUNCTIONS
>   	select GENERIC_PINCONF
> 
> ---
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> change-id: 20250207-k1-pinctrl-option-de5bdfd6b42e
> 
> Best regards,
Yixun Lan Feb. 12, 2025, 2:17 p.m. UTC | #2
Hi Alex:

On 07:50 Wed 12 Feb     , Alex Elder wrote:
> On 2/12/25 2:27 AM, Yixun Lan wrote:
> > Pinctrl is an essential driver for SpacemiT's SoC,
> > so let's enable it by default for this SoC.
> > 
> > The CONFIG_PINCTRL_SPACEMIT_K1 isn't enabled when using
> > 'make defconfig' to select kernel configuration options.
> > This result in a broken uart driver where fail at probe()
> > stage due to no pins found.
> > 
> > Fixes: a83c29e1d145 ("pinctrl: spacemit: add support for SpacemiT K1 SoC")
> > Reported-by: Alex Elder <elder@kernel.org>
> > Acked-by: Conor Dooley <conor.dooley@microchip.com>
> > Tested-by: Alex Elder <elder@riscstar.com>
> > Signed-off-by: Yixun Lan <dlan@gentoo.org>
> 
> I just tested this version of the patch.  By default
> PINCTRL_SPACEMIT_K1 is "y".  But since it's tristate,
> perhaps it should be default=m so it's not built in
> for everyone.  Yixun I assume the K1 pinctrl driver
> actually *works* as a kernel module.
> 
in theory, making it built as module, it should work fine if all drivers
can handle "deferred probe" gracefully, but since pinctrl is an essential
 basic driver, I'd prefer to make it built-in ..

I didn't bother to change this module from tristate to bool,
as there is additional COMPILE_TEST option(maybe it want to test as module?)

> Anyway, I suggest this change to be a module; Conor
> should weigh in.  Either way is good for me, and I
> have tested both.
> 
no, I don't think making it as module is a good idea,

I can adjust this driver from tristate to bool if necessary,
also adjust to builtin_platform_driver() in driver..

let me know what you think

> Reviewed-by: Alex Elder <elder@riscstar.com>
> 
> > ---
> > This should fix problem that CONFIG_PINCTRL_SPACEMIT_K1 is not enabled
> > when using make defconfig, thus fail to initilize uart driver which requst
> > pins during probe stage.
> > ---
> > Changes in v2:
> > - set default as y
> > - Link to v1: https://lore.kernel.org/r/20250207-k1-pinctrl-option-v1-1-e8a7e4d8404f@gentoo.org
> > ---
> >   arch/riscv/Kconfig.socs          | 1 +
> >   drivers/pinctrl/spacemit/Kconfig | 1 +
> >   2 files changed, 2 insertions(+)
> > 
> > diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> > index 1916cf7ba450ec9958265de2ca41dc504d4d2f7c..17606940bb5239d0fdfc6b5aefb50eeb982d14aa 100644
> > --- a/arch/riscv/Kconfig.socs
> > +++ b/arch/riscv/Kconfig.socs
> > @@ -26,6 +26,7 @@ config ARCH_SOPHGO
> >   
> >   config ARCH_SPACEMIT
> >   	bool "SpacemiT SoCs"
> > +	select PINCTRL
> >   	help
> >   	  This enables support for SpacemiT SoC platform hardware.
> >   
> > diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig
> > index 168f8a5ffbb952cbeae3e3401c11149558e0a84b..c18d879274e72df251e0bc82a308603ce23738bd 100644
> > --- a/drivers/pinctrl/spacemit/Kconfig
> > +++ b/drivers/pinctrl/spacemit/Kconfig
> > @@ -7,6 +7,7 @@ config PINCTRL_SPACEMIT_K1
> >   	tristate "SpacemiT K1 SoC Pinctrl driver"
> >   	depends on ARCH_SPACEMIT || COMPILE_TEST
> >   	depends on OF
> > +	default y
> >   	select GENERIC_PINCTRL_GROUPS
> >   	select GENERIC_PINMUX_FUNCTIONS
> >   	select GENERIC_PINCONF
> > 
> > ---
> > base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> > change-id: 20250207-k1-pinctrl-option-de5bdfd6b42e
> > 
> > Best regards,
>
diff mbox series

Patch

diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 1916cf7ba450ec9958265de2ca41dc504d4d2f7c..17606940bb5239d0fdfc6b5aefb50eeb982d14aa 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -26,6 +26,7 @@  config ARCH_SOPHGO
 
 config ARCH_SPACEMIT
 	bool "SpacemiT SoCs"
+	select PINCTRL
 	help
 	  This enables support for SpacemiT SoC platform hardware.
 
diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig
index 168f8a5ffbb952cbeae3e3401c11149558e0a84b..c18d879274e72df251e0bc82a308603ce23738bd 100644
--- a/drivers/pinctrl/spacemit/Kconfig
+++ b/drivers/pinctrl/spacemit/Kconfig
@@ -7,6 +7,7 @@  config PINCTRL_SPACEMIT_K1
 	tristate "SpacemiT K1 SoC Pinctrl driver"
 	depends on ARCH_SPACEMIT || COMPILE_TEST
 	depends on OF
+	default y
 	select GENERIC_PINCTRL_GROUPS
 	select GENERIC_PINMUX_FUNCTIONS
 	select GENERIC_PINCONF