All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
@ 2022-04-20 11:55 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20 11:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Tomasz Figa,
	Sylwester Nawrocki, Linus Walleij, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-gpio
  Cc: Arnd Bergmann, Necip Fazil Yildiran, stable

The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
Exynos selects only the latter leading to possible wrong configuration
on ARMv8 build:

  WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
    Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
    Selected by [y]:
    - ARCH_EXYNOS [=y]

Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Original report:
https://bugzilla.kernel.org/show_bug.cgi?id=210047
---
 arch/arm/mach-exynos/Kconfig    | 1 -
 drivers/pinctrl/samsung/Kconfig | 6 ++----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 51a336f349f4..4d3b40e4049a 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -16,7 +16,6 @@ menuconfig ARCH_EXYNOS
 	select EXYNOS_PMU
 	select EXYNOS_SROM
 	select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
-	select GPIOLIB
 	select HAVE_ARM_ARCH_TIMER if ARCH_EXYNOS5
 	select HAVE_ARM_SCU if SMP
 	select PINCTRL
diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
index dfd805e76862..c852fd1dd284 100644
--- a/drivers/pinctrl/samsung/Kconfig
+++ b/drivers/pinctrl/samsung/Kconfig
@@ -4,13 +4,13 @@
 #
 config PINCTRL_SAMSUNG
 	bool
-	depends on OF_GPIO
+	select GPIOLIB
+	select OF_GPIO
 	select PINMUX
 	select PINCONF
 
 config PINCTRL_EXYNOS
 	bool "Pinctrl common driver part for Samsung Exynos SoCs"
-	depends on OF_GPIO
 	depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
 	select PINCTRL_SAMSUNG
 	select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
@@ -26,12 +26,10 @@ config PINCTRL_EXYNOS_ARM64
 
 config PINCTRL_S3C24XX
 	bool "Samsung S3C24XX SoC pinctrl driver"
-	depends on OF_GPIO
 	depends on ARCH_S3C24XX || COMPILE_TEST
 	select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
 	bool "Samsung S3C64XX SoC pinctrl driver"
-	depends on OF_GPIO
 	depends on ARCH_S3C64XX || COMPILE_TEST
 	select PINCTRL_SAMSUNG
-- 
2.32.0


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

* [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
@ 2022-04-20 11:55 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20 11:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Alim Akhtar, Tomasz Figa,
	Sylwester Nawrocki, Linus Walleij, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, linux-gpio
  Cc: Arnd Bergmann, Necip Fazil Yildiran, stable

The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
Exynos selects only the latter leading to possible wrong configuration
on ARMv8 build:

  WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
    Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
    Selected by [y]:
    - ARCH_EXYNOS [=y]

Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Original report:
https://bugzilla.kernel.org/show_bug.cgi?id=210047
---
 arch/arm/mach-exynos/Kconfig    | 1 -
 drivers/pinctrl/samsung/Kconfig | 6 ++----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 51a336f349f4..4d3b40e4049a 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -16,7 +16,6 @@ menuconfig ARCH_EXYNOS
 	select EXYNOS_PMU
 	select EXYNOS_SROM
 	select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
-	select GPIOLIB
 	select HAVE_ARM_ARCH_TIMER if ARCH_EXYNOS5
 	select HAVE_ARM_SCU if SMP
 	select PINCTRL
diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
index dfd805e76862..c852fd1dd284 100644
--- a/drivers/pinctrl/samsung/Kconfig
+++ b/drivers/pinctrl/samsung/Kconfig
@@ -4,13 +4,13 @@
 #
 config PINCTRL_SAMSUNG
 	bool
-	depends on OF_GPIO
+	select GPIOLIB
+	select OF_GPIO
 	select PINMUX
 	select PINCONF
 
 config PINCTRL_EXYNOS
 	bool "Pinctrl common driver part for Samsung Exynos SoCs"
-	depends on OF_GPIO
 	depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
 	select PINCTRL_SAMSUNG
 	select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
@@ -26,12 +26,10 @@ config PINCTRL_EXYNOS_ARM64
 
 config PINCTRL_S3C24XX
 	bool "Samsung S3C24XX SoC pinctrl driver"
-	depends on OF_GPIO
 	depends on ARCH_S3C24XX || COMPILE_TEST
 	select PINCTRL_SAMSUNG
 
 config PINCTRL_S3C64XX
 	bool "Samsung S3C64XX SoC pinctrl driver"
-	depends on OF_GPIO
 	depends on ARCH_S3C64XX || COMPILE_TEST
 	select PINCTRL_SAMSUNG
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
  2022-04-20 11:55 ` Krzysztof Kozlowski
@ 2022-04-20 12:10   ` Arnd Bergmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-04-20 12:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alim Akhtar, Tomasz Figa, Sylwester Nawrocki, Linus Walleij,
	Linux ARM, moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Arnd Bergmann, Necip Fazil Yildiran, # 3.4.x

On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
> Exynos selects only the latter leading to possible wrong configuration
> on ARMv8 build:
>
>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
>     Selected by [y]:
>     - ARCH_EXYNOS [=y]
>
> Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
> Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>

This does not look like a correct fix:

> diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
> index dfd805e76862..c852fd1dd284 100644
> --- a/drivers/pinctrl/samsung/Kconfig
> +++ b/drivers/pinctrl/samsung/Kconfig
> @@ -4,13 +4,13 @@
>  #
>  config PINCTRL_SAMSUNG
>         bool
> -       depends on OF_GPIO
> +       select GPIOLIB
> +       select OF_GPIO
>         select PINMUX
>         select PINCONF

OF_GPIO is an automatic symbol that is always enabled when both
GPIOLIB and OF are enabled. Selecting it from somewhere else cannot
really work at all. I see we have a few other instances and should probably
fix those as well.

>  config PINCTRL_EXYNOS
>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
> -       depends on OF_GPIO
>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
>         select PINCTRL_SAMSUNG
>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)


The problem here is that PINCTRL_EXYNOS and the others can be built for
compile-testing without CONFIG_OF on non-arm machines.

I think the correct dependency line would be

      depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)

which guarantees that OF_GPIO is also enabled.

    Arnd

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
@ 2022-04-20 12:10   ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-04-20 12:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Alim Akhtar, Tomasz Figa, Sylwester Nawrocki, Linus Walleij,
	Linux ARM, moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Arnd Bergmann, Necip Fazil Yildiran, # 3.4.x

On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
> Exynos selects only the latter leading to possible wrong configuration
> on ARMv8 build:
>
>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
>     Selected by [y]:
>     - ARCH_EXYNOS [=y]
>
> Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
> Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>

This does not look like a correct fix:

> diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
> index dfd805e76862..c852fd1dd284 100644
> --- a/drivers/pinctrl/samsung/Kconfig
> +++ b/drivers/pinctrl/samsung/Kconfig
> @@ -4,13 +4,13 @@
>  #
>  config PINCTRL_SAMSUNG
>         bool
> -       depends on OF_GPIO
> +       select GPIOLIB
> +       select OF_GPIO
>         select PINMUX
>         select PINCONF

OF_GPIO is an automatic symbol that is always enabled when both
GPIOLIB and OF are enabled. Selecting it from somewhere else cannot
really work at all. I see we have a few other instances and should probably
fix those as well.

>  config PINCTRL_EXYNOS
>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
> -       depends on OF_GPIO
>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
>         select PINCTRL_SAMSUNG
>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)


The problem here is that PINCTRL_EXYNOS and the others can be built for
compile-testing without CONFIG_OF on non-arm machines.

I think the correct dependency line would be

      depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)

which guarantees that OF_GPIO is also enabled.

    Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
  2022-04-20 12:10   ` Arnd Bergmann
@ 2022-04-20 12:13     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20 12:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alim Akhtar, Tomasz Figa, Sylwester Nawrocki, Linus Walleij,
	Linux ARM, moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Necip Fazil Yildiran, # 3.4.x

On 20/04/2022 14:10, Arnd Bergmann wrote:
> On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
>> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
>> Exynos selects only the latter leading to possible wrong configuration
>> on ARMv8 build:
>>
>>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
>>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
>>     Selected by [y]:
>>     - ARCH_EXYNOS [=y]
>>
>> Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
>> Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
> 
> This does not look like a correct fix:
> 
>> diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
>> index dfd805e76862..c852fd1dd284 100644
>> --- a/drivers/pinctrl/samsung/Kconfig
>> +++ b/drivers/pinctrl/samsung/Kconfig
>> @@ -4,13 +4,13 @@
>>  #
>>  config PINCTRL_SAMSUNG
>>         bool
>> -       depends on OF_GPIO
>> +       select GPIOLIB
>> +       select OF_GPIO
>>         select PINMUX
>>         select PINCONF
> 
> OF_GPIO is an automatic symbol that is always enabled when both
> GPIOLIB and OF are enabled. Selecting it from somewhere else cannot
> really work at all. I see we have a few other instances and should probably
> fix those as well.

True, OF_GPIO I could skip here.

> 
>>  config PINCTRL_EXYNOS
>>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
>> -       depends on OF_GPIO
>>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
>>         select PINCTRL_SAMSUNG
>>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
> 
> 
> The problem here is that PINCTRL_EXYNOS and the others can be built for
> compile-testing without CONFIG_OF on non-arm machines.
> 
> I think the correct dependency line would be
> 
>       depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
> 
> which guarantees that OF_GPIO is also enabled.

I don't think OF is the problem here, because the error is in missing
GPIOLIB. The platform selects Samsung pinctrl but it does not select
GPIOLIB. Possible fixes are:
1. Do not select Samsung pinctrl from the platform (but have some
default), so on compile test build it might not work.
2. Select GPIOLIB from the platform (ARMv7 Exynos does it).
3. Select GPIOLIB from here - this is current proposal.


Best regards,
Krzysztof

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
@ 2022-04-20 12:13     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-20 12:13 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Alim Akhtar, Tomasz Figa, Sylwester Nawrocki, Linus Walleij,
	Linux ARM, moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Necip Fazil Yildiran, # 3.4.x

On 20/04/2022 14:10, Arnd Bergmann wrote:
> On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
>> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
>> Exynos selects only the latter leading to possible wrong configuration
>> on ARMv8 build:
>>
>>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
>>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
>>     Selected by [y]:
>>     - ARCH_EXYNOS [=y]
>>
>> Reported-by: Necip Fazil Yildiran <fazilyildiran@gmail.com>
>> Fixes: eed6b3eb20b9 ("arm64: Split out platform options to separate Kconfig")
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
> 
> This does not look like a correct fix:
> 
>> diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
>> index dfd805e76862..c852fd1dd284 100644
>> --- a/drivers/pinctrl/samsung/Kconfig
>> +++ b/drivers/pinctrl/samsung/Kconfig
>> @@ -4,13 +4,13 @@
>>  #
>>  config PINCTRL_SAMSUNG
>>         bool
>> -       depends on OF_GPIO
>> +       select GPIOLIB
>> +       select OF_GPIO
>>         select PINMUX
>>         select PINCONF
> 
> OF_GPIO is an automatic symbol that is always enabled when both
> GPIOLIB and OF are enabled. Selecting it from somewhere else cannot
> really work at all. I see we have a few other instances and should probably
> fix those as well.

True, OF_GPIO I could skip here.

> 
>>  config PINCTRL_EXYNOS
>>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
>> -       depends on OF_GPIO
>>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
>>         select PINCTRL_SAMSUNG
>>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
> 
> 
> The problem here is that PINCTRL_EXYNOS and the others can be built for
> compile-testing without CONFIG_OF on non-arm machines.
> 
> I think the correct dependency line would be
> 
>       depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
> 
> which guarantees that OF_GPIO is also enabled.

I don't think OF is the problem here, because the error is in missing
GPIOLIB. The platform selects Samsung pinctrl but it does not select
GPIOLIB. Possible fixes are:
1. Do not select Samsung pinctrl from the platform (but have some
default), so on compile test build it might not work.
2. Select GPIOLIB from the platform (ARMv7 Exynos does it).
3. Select GPIOLIB from here - this is current proposal.


Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
  2022-04-20 12:13     ` Krzysztof Kozlowski
@ 2022-04-20 13:25       ` Arnd Bergmann
  -1 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-04-20 13:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Arnd Bergmann, Alim Akhtar, Tomasz Figa, Sylwester Nawrocki,
	Linus Walleij, Linux ARM,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Necip Fazil Yildiran, # 3.4.x

On Wed, Apr 20, 2022 at 2:13 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> On 20/04/2022 14:10, Arnd Bergmann wrote:
> > On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
> >> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
> >> Exynos selects only the latter leading to possible wrong configuration
> >> on ARMv8 build:
> >>
> >>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
> >>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
> >>     Selected by [y]:
> >>     - ARCH_EXYNOS [=y]
> >>
> >>  config PINCTRL_EXYNOS
> >>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
> >> -       depends on OF_GPIO
> >>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
> >>         select PINCTRL_SAMSUNG
> >>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
> >
> >
> > The problem here is that PINCTRL_EXYNOS and the others can be built for
> > compile-testing without CONFIG_OF on non-arm machines.
> >
> > I think the correct dependency line would be
> >
> >       depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
> >
> > which guarantees that OF_GPIO is also enabled.
>
> I don't think OF is the problem here, because the error is in missing
> GPIOLIB.

You are correct that the added dependency is not the solution for the
original problem. What I meant is that by dropping the dependency on
OF_GPIO, you create a new problem for compile-testing without
CONFIG_OF. Adding back the OF dependency avoids the regression.

> The platform selects Samsung pinctrl but it does not select
> GPIOLIB. Possible fixes are:
> 1. Do not select Samsung pinctrl from the platform (but have some
> default), so on compile test build it might not work.
> 2. Select GPIOLIB from the platform (ARMv7 Exynos does it).
> 3. Select GPIOLIB from here - this is current proposal.

Agreed, either 2. or 3. is fine, as long as you keep the CONFIG_OF
dependency.

       Arnd

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

* Re: [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config
@ 2022-04-20 13:25       ` Arnd Bergmann
  0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2022-04-20 13:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Arnd Bergmann, Alim Akhtar, Tomasz Figa, Sylwester Nawrocki,
	Linus Walleij, Linux ARM,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux Kernel Mailing List, open list:GPIO SUBSYSTEM,
	Necip Fazil Yildiran, # 3.4.x

On Wed, Apr 20, 2022 at 2:13 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> On 20/04/2022 14:10, Arnd Bergmann wrote:
> > On Wed, Apr 20, 2022 at 1:55 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> The Samsung pinctrl drivers depend on OF_GPIO, which is part of GPIOLIB.
> >> ARMv7 Exynos platform selects GPIOLIB and Samsung pinctrl drivers. ARMv8
> >> Exynos selects only the latter leading to possible wrong configuration
> >> on ARMv8 build:
> >>
> >>   WARNING: unmet direct dependencies detected for PINCTRL_EXYNOS
> >>     Depends on [n]: PINCTRL [=y] && OF_GPIO [=n] && (ARCH_EXYNOS [=y] || ARCH_S5PV210 || COMPILE_TEST [=y])
> >>     Selected by [y]:
> >>     - ARCH_EXYNOS [=y]
> >>
> >>  config PINCTRL_EXYNOS
> >>         bool "Pinctrl common driver part for Samsung Exynos SoCs"
> >> -       depends on OF_GPIO
> >>         depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
> >>         select PINCTRL_SAMSUNG
> >>         select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
> >
> >
> > The problem here is that PINCTRL_EXYNOS and the others can be built for
> > compile-testing without CONFIG_OF on non-arm machines.
> >
> > I think the correct dependency line would be
> >
> >       depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
> >
> > which guarantees that OF_GPIO is also enabled.
>
> I don't think OF is the problem here, because the error is in missing
> GPIOLIB.

You are correct that the added dependency is not the solution for the
original problem. What I meant is that by dropping the dependency on
OF_GPIO, you create a new problem for compile-testing without
CONFIG_OF. Adding back the OF dependency avoids the regression.

> The platform selects Samsung pinctrl but it does not select
> GPIOLIB. Possible fixes are:
> 1. Do not select Samsung pinctrl from the platform (but have some
> default), so on compile test build it might not work.
> 2. Select GPIOLIB from the platform (ARMv7 Exynos does it).
> 3. Select GPIOLIB from here - this is current proposal.

Agreed, either 2. or 3. is fine, as long as you keep the CONFIG_OF
dependency.

       Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-04-20 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 11:55 [PATCH] pinctrl: samsung: fix missing GPIOLIB on ARM64 Exynos config Krzysztof Kozlowski
2022-04-20 11:55 ` Krzysztof Kozlowski
2022-04-20 12:10 ` Arnd Bergmann
2022-04-20 12:10   ` Arnd Bergmann
2022-04-20 12:13   ` Krzysztof Kozlowski
2022-04-20 12:13     ` Krzysztof Kozlowski
2022-04-20 13:25     ` Arnd Bergmann
2022-04-20 13:25       ` Arnd Bergmann

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.