linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] x86: apuv2: remove unused variable
@ 2019-03-04 20:19 Arnd Bergmann
  2019-03-04 20:19 ` [PATCH 2/3] x86: apuv2: fix input dependencies Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Arnd Bergmann @ 2019-03-04 20:19 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, Darren Hart, Andy Shevchenko
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, Arnd Bergmann,
	Linus Walleij, platform-driver-x86, linux-kernel

The driver was newly introduced but the version that got merged
produces a harmless compiler warning:

drivers/platform/x86/pcengines-apuv2.c: In function 'apu_board_init':
drivers/platform/x86/pcengines-apuv2.c:211:6: error: unused variable 'rc' [-Werror=unused-variable]

Remove the evidently useless variable.

Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/pcengines-apuv2.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/platform/x86/pcengines-apuv2.c b/drivers/platform/x86/pcengines-apuv2.c
index dcb084f6b892..c1ca931e1fab 100644
--- a/drivers/platform/x86/pcengines-apuv2.c
+++ b/drivers/platform/x86/pcengines-apuv2.c
@@ -208,7 +208,6 @@ static struct platform_device * __init apu_create_pdev(
 
 static int __init apu_board_init(void)
 {
-	int rc;
 	const struct dmi_system_id *id;
 
 	id = dmi_first_match(apu_gpio_dmi_table);
-- 
2.20.0


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

* [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-04 20:19 [PATCH 1/3] x86: apuv2: remove unused variable Arnd Bergmann
@ 2019-03-04 20:19 ` Arnd Bergmann
  2019-03-05  0:18   ` Enrico Weigelt, metux IT consult
  2019-03-04 20:19 ` [PATCH 3/3] x86: apuv2: select LEDS_CLASS Arnd Bergmann
  2019-03-05  0:04 ` [PATCH 1/3] x86: apuv2: remove unused variable Enrico Weigelt, metux IT consult
  2 siblings, 1 reply; 15+ messages in thread
From: Arnd Bergmann @ 2019-03-04 20:19 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Linus Walleij, Enrico Weigelt, Andy Shevchenko, linux-gpio,
	Arnd Bergmann, platform-driver-x86, linux-kernel

We cannot select KEYBOARD_GPIO_POLLED if CONFIG_INPUT or CONFIG_INPUT_KEYBOARD
are disabled:

WARNING: unmet direct dependencies detected for KEYBOARD_GPIO_POLLED
  Depends on [n]: !UML && INPUT [=y] && INPUT_KEYBOARD [=n] && GPIOLIB [=y]
  Selected by [y]:
  - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y]

This could be fixed using either a dependency or a 'select' statement.
I'm chosen 'depends on' here since it is simpler has a lower risk of
introducing circular dependencies.

Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 851ea921a58d..4d65d37b0c86 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1305,6 +1305,7 @@ config HUAWEI_WMI
 
 config PCENGINES_APU2
 	tristate "PC Engines APUv2/3 front button and LEDs driver"
+	depends on INPUT && INPUT_KEYBOARD
 	select GPIO_AMD_FCH
 	select KEYBOARD_GPIO_POLLED
 	select LEDS_GPIO
-- 
2.20.0


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

* [PATCH 3/3] x86: apuv2: select LEDS_CLASS
  2019-03-04 20:19 [PATCH 1/3] x86: apuv2: remove unused variable Arnd Bergmann
  2019-03-04 20:19 ` [PATCH 2/3] x86: apuv2: fix input dependencies Arnd Bergmann
@ 2019-03-04 20:19 ` Arnd Bergmann
  2019-03-05  0:03   ` Enrico Weigelt, metux IT consult
  2019-03-05  0:04 ` [PATCH 1/3] x86: apuv2: remove unused variable Enrico Weigelt, metux IT consult
  2 siblings, 1 reply; 15+ messages in thread
From: Arnd Bergmann @ 2019-03-04 20:19 UTC (permalink / raw)
  To: Darren Hart, Andy Shevchenko
  Cc: Linus Walleij, Enrico Weigelt, Andy Shevchenko, linux-gpio,
	Arnd Bergmann, platform-driver-x86, linux-kernel

LEDS_GPIO can only be selected when LEDS_CLASS is already enabled:

WARNING: unmet direct dependencies detected for LEDS_GPIO
  Depends on [m]: NEW_LEDS [=y] && LEDS_CLASS [=m] && (GPIOLIB [=y] || COMPILE_TEST [=y])
  Selected by [y]:
  - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT_KEYBOARD [=y]

Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 4d65d37b0c86..d64529352a9c 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -1308,6 +1308,7 @@ config PCENGINES_APU2
 	depends on INPUT && INPUT_KEYBOARD
 	select GPIO_AMD_FCH
 	select KEYBOARD_GPIO_POLLED
+	select LEDS_CLASS
 	select LEDS_GPIO
 	help
 	  This driver provides support for the front button and LEDs on
-- 
2.20.0


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

* Re: [PATCH 3/3] x86: apuv2: select LEDS_CLASS
  2019-03-04 20:19 ` [PATCH 3/3] x86: apuv2: select LEDS_CLASS Arnd Bergmann
@ 2019-03-05  0:03   ` Enrico Weigelt, metux IT consult
  2019-03-05  0:09     ` Randy Dunlap
  0 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-05  0:03 UTC (permalink / raw)
  To: Arnd Bergmann, Darren Hart, Andy Shevchenko
  Cc: Linus Walleij, Enrico Weigelt, Andy Shevchenko, linux-gpio,
	platform-driver-x86, linux-kernel

On 04.03.19 21:19, Arnd Bergmann wrote:
> LEDS_GPIO can only be selected when LEDS_CLASS is already enabled:
> 
> WARNING: unmet direct dependencies detected for LEDS_GPIO
>   Depends on [m]: NEW_LEDS [=y] && LEDS_CLASS [=m] && (GPIOLIB [=y] || COMPILE_TEST [=y])
>   Selected by [y]:
>   - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT_KEYBOARD [=y]
> 
> Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/platform/x86/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 4d65d37b0c86..d64529352a9c 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -1308,6 +1308,7 @@ config PCENGINES_APU2
>  	depends on INPUT && INPUT_KEYBOARD
>  	select GPIO_AMD_FCH
>  	select KEYBOARD_GPIO_POLLED
> +	select LEDS_CLASS
>  	select LEDS_GPIO
>  	help
>  	  This driver provides support for the front button and LEDs on
> 

ACK. Just was about to post the same :)

Reviewed-by: Enrico Weigelt, metux It consult <info@metux.net>


thx.

--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH 1/3] x86: apuv2: remove unused variable
  2019-03-04 20:19 [PATCH 1/3] x86: apuv2: remove unused variable Arnd Bergmann
  2019-03-04 20:19 ` [PATCH 2/3] x86: apuv2: fix input dependencies Arnd Bergmann
  2019-03-04 20:19 ` [PATCH 3/3] x86: apuv2: select LEDS_CLASS Arnd Bergmann
@ 2019-03-05  0:04 ` Enrico Weigelt, metux IT consult
  2019-03-05 13:47   ` Andy Shevchenko
  2 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-05  0:04 UTC (permalink / raw)
  To: Arnd Bergmann, Enrico Weigelt, metux IT consult, Darren Hart,
	Andy Shevchenko
  Cc: Linus Walleij, Andy Shevchenko, linux-gpio, Linus Walleij,
	platform-driver-x86, linux-kernel

On 04.03.19 21:19, Arnd Bergmann wrote:

> diff --git a/drivers/platform/x86/pcengines-apuv2.c b/drivers/platform/x86/pcengines-apuv2.c
> index dcb084f6b892..c1ca931e1fab 100644
> --- a/drivers/platform/x86/pcengines-apuv2.c
> +++ b/drivers/platform/x86/pcengines-apuv2.c
> @@ -208,7 +208,6 @@ static struct platform_device * __init apu_create_pdev(
>  
>  static int __init apu_board_init(void)
>  {
> -	int rc;
>  	const struct dmi_system_id *id;
>  
>  	id = dmi_first_match(apu_gpio_dmi_table);
> 

ACK.

Reviewed-By: Enrico Weigelt, metux IT consult <info@metux.net>


thx
--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH 3/3] x86: apuv2: select LEDS_CLASS
  2019-03-05  0:03   ` Enrico Weigelt, metux IT consult
@ 2019-03-05  0:09     ` Randy Dunlap
  2019-03-08  9:05       ` Linus Walleij
  0 siblings, 1 reply; 15+ messages in thread
From: Randy Dunlap @ 2019-03-05  0:09 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, Arnd Bergmann, Darren Hart,
	Andy Shevchenko
  Cc: Linus Walleij, Enrico Weigelt, Andy Shevchenko, linux-gpio,
	platform-driver-x86, linux-kernel

On 3/4/19 4:03 PM, Enrico Weigelt, metux IT consult wrote:
> On 04.03.19 21:19, Arnd Bergmann wrote:
>> LEDS_GPIO can only be selected when LEDS_CLASS is already enabled:
>>
>> WARNING: unmet direct dependencies detected for LEDS_GPIO
>>   Depends on [m]: NEW_LEDS [=y] && LEDS_CLASS [=m] && (GPIOLIB [=y] || COMPILE_TEST [=y])
>>   Selected by [y]:
>>   - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT_KEYBOARD [=y]
>>
>> Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  drivers/platform/x86/Kconfig | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
>> index 4d65d37b0c86..d64529352a9c 100644
>> --- a/drivers/platform/x86/Kconfig
>> +++ b/drivers/platform/x86/Kconfig
>> @@ -1308,6 +1308,7 @@ config PCENGINES_APU2
>>  	depends on INPUT && INPUT_KEYBOARD
>>  	select GPIO_AMD_FCH
>>  	select KEYBOARD_GPIO_POLLED
>> +	select LEDS_CLASS
>>  	select LEDS_GPIO
>>  	help
>>  	  This driver provides support for the front button and LEDs on
>>
> 
> ACK. Just was about to post the same :)
> 
> Reviewed-by: Enrico Weigelt, metux It consult <info@metux.net>
> 

Enrico, you were also cc-ed on this patch on Feb.25, 2019:

https://marc.info/?l=linux-kernel&m=155113875310485&w=2


> 
> thx.
> 
> --mtx
> 


-- 
~Randy

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-04 20:19 ` [PATCH 2/3] x86: apuv2: fix input dependencies Arnd Bergmann
@ 2019-03-05  0:18   ` Enrico Weigelt, metux IT consult
  2019-03-05  8:23     ` Arnd Bergmann
  0 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-05  0:18 UTC (permalink / raw)
  To: Arnd Bergmann, Darren Hart, Andy Shevchenko
  Cc: Linus Walleij, Enrico Weigelt, Andy Shevchenko, linux-gpio,
	platform-driver-x86, linux-kernel

On 04.03.19 21:19, Arnd Bergmann wrote:

> This could be fixed using either a dependency or a 'select' statement.
> I'm chosen 'depends on' here since it is simpler has a lower risk of
> introducing circular dependencies.

I'd rather prefer using 'select'.

Otherwise the driver won't appear at all if INPUT or INPUT_KEYBOARD
aren't enabled (eg. when you start w/ minimal config - which I do
frequently), and people have a hard time actually finding/enabling it.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-05  0:18   ` Enrico Weigelt, metux IT consult
@ 2019-03-05  8:23     ` Arnd Bergmann
  2019-03-05 13:50       ` Enrico Weigelt, metux IT consult
  0 siblings, 1 reply; 15+ messages in thread
From: Arnd Bergmann @ 2019-03-05  8:23 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Darren Hart, Andy Shevchenko, Linus Walleij, Enrico Weigelt,
	Andy Shevchenko, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List

On Tue, Mar 5, 2019 at 1:18 AM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
>
> On 04.03.19 21:19, Arnd Bergmann wrote:
>
> > This could be fixed using either a dependency or a 'select' statement.
> > I'm chosen 'depends on' here since it is simpler has a lower risk of
> > introducing circular dependencies.
>
> I'd rather prefer using 'select'.
>
> Otherwise the driver won't appear at all if INPUT or INPUT_KEYBOARD
> aren't enabled (eg. when you start w/ minimal config - which I do
> frequently), and people have a hard time actually finding/enabling it.

No, that wouldn't be good here. In effect that means that with INPUT disabled,
most of the x86 platform drivers are disabled, until you enable the
PCENGINES_APU2 symbol, which then ends up showing all the other
symbols at once, and changing them to their default states.

Another problem is that you likely run into circular dependency chains
after trying that. The best practice for select vs. depends are

1. try to use 'depends on' if you can
2. use 'select' on hidden symbols, but not user visible ones
3. for each symbol, use either 'depends on'  or 'select' from all other
    drivers that need it, and do it consistently
4. never select entire subsystems, only helper code.

Those are sometimes at odds. I used 'select' for the LEDS code
because of 3. and 4, even though that goes against 2. For INPUT,
there is no real debate though.

   Arnd

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

* Re: [PATCH 1/3] x86: apuv2: remove unused variable
  2019-03-05  0:04 ` [PATCH 1/3] x86: apuv2: remove unused variable Enrico Weigelt, metux IT consult
@ 2019-03-05 13:47   ` Andy Shevchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2019-03-05 13:47 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Arnd Bergmann, Enrico Weigelt, metux IT consult, Darren Hart,
	Andy Shevchenko, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linus Walleij, Platform Driver, Linux Kernel Mailing List

On Tue, Mar 5, 2019 at 2:04 AM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
>
> On 04.03.19 21:19, Arnd Bergmann wrote:
>
> > diff --git a/drivers/platform/x86/pcengines-apuv2.c b/drivers/platform/x86/pcengines-apuv2.c
> > index dcb084f6b892..c1ca931e1fab 100644
> > --- a/drivers/platform/x86/pcengines-apuv2.c
> > +++ b/drivers/platform/x86/pcengines-apuv2.c
> > @@ -208,7 +208,6 @@ static struct platform_device * __init apu_create_pdev(
> >
> >  static int __init apu_board_init(void)
> >  {
> > -     int rc;
> >       const struct dmi_system_id *id;
> >
> >       id = dmi_first_match(apu_gpio_dmi_table);
> >
>
> ACK.
>
> Reviewed-By: Enrico Weigelt, metux IT consult <info@metux.net>

Patches from here presumably should go to v5.1-rc1 or, if Linus would
do it, through his tree.

Linus, I'm fine with what Randy and Arnd sent for fixing this driver.

>
>
> thx
> --mtx
>
> --
> Enrico Weigelt, metux IT consult
> Free software and Linux embedded engineering
> info@metux.net -- +49-151-27565287



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-05  8:23     ` Arnd Bergmann
@ 2019-03-05 13:50       ` Enrico Weigelt, metux IT consult
  2019-03-05 13:56         ` Andy Shevchenko
  2019-03-05 16:46         ` Arnd Bergmann
  0 siblings, 2 replies; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-05 13:50 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Darren Hart, Andy Shevchenko, Linus Walleij, Enrico Weigelt,
	Andy Shevchenko, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List, yamada.masahiro, linux-kbuild

On 05.03.19 09:23, Arnd Bergmann wrote:

(CC'ing kbuild maintainer + list, hoping for better ideas :)


> No, that wouldn't be good here. In effect that means that with INPUT disabled,
> most of the x86 platform drivers are disabled, until you enable the
> PCENGINES_APU2 symbol, which then ends up showing all the other
> symbols at once, and changing them to their default states.

Okay, I didn't consider the defaults.

Maybe we should talk about step by step getting away from these defaults
(perhaps move them to the defconfigs ?) on a broader scale ... but yeah,
that's far out of scope now.

So, you've conviced me.
Add me to Reviewed-By to your patches and forget about mine.

> Another problem is that you likely run into circular dependency chains
> after trying that. The best practice for select vs. depends are

hmm, if circular deps happen, wouldn't that mean we've got some deeper
problems in here ? IMHO, dependencies should always form a DAG (except
for some really rare cases).

Do you recall any actual problem w/ input vs gpio vs. drivers ?
I'd like to have a closer look at it.

> 1. try to use 'depends on' if you can

Well, this has the unpleasant side effect that we often have to enable
a lot of things, just to even see the individual driver. For people who
just wanna configure a kernel for their board, this is a bit nasty.

But, okay, I'm going to do this w/ my own tool - I've written a small
tool that allows easy kernel reconfiguration on a higher level: you
can just pick some board templates and enable high level features like
eth, gpu, etc - it automatically creates a .config for you. I'm going
announce it on lkml soon.


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-05 13:50       ` Enrico Weigelt, metux IT consult
@ 2019-03-05 13:56         ` Andy Shevchenko
  2019-03-07  0:10           ` Enrico Weigelt, metux IT consult
  2019-03-05 16:46         ` Arnd Bergmann
  1 sibling, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2019-03-05 13:56 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Arnd Bergmann, Darren Hart, Andy Shevchenko, Linus Walleij,
	Enrico Weigelt, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List, Masahiro Yamada, linux-kbuild

On Tue, Mar 5, 2019 at 3:50 PM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
> On 05.03.19 09:23, Arnd Bergmann wrote:

> > 1. try to use 'depends on' if you can
>
> Well, this has the unpleasant side effect that we often have to enable
> a lot of things, just to even see the individual driver. For people who
> just wanna configure a kernel for their board, this is a bit nasty.
>
> But, okay, I'm going to do this w/ my own tool - I've written a small
> tool that allows easy kernel reconfiguration on a higher level: you
> can just pick some board templates and enable high level features like
> eth, gpu, etc - it automatically creates a .config for you. I'm going
> announce it on lkml soon.

Darren gave a talk about merging kernel configs to get something like
you want to.
This tool is quite long already lying around. merge_config.sh in your
kernel source tree.

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-05 13:50       ` Enrico Weigelt, metux IT consult
  2019-03-05 13:56         ` Andy Shevchenko
@ 2019-03-05 16:46         ` Arnd Bergmann
  1 sibling, 0 replies; 15+ messages in thread
From: Arnd Bergmann @ 2019-03-05 16:46 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Darren Hart, Andy Shevchenko, Linus Walleij, Enrico Weigelt,
	Andy Shevchenko, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List, Masahiro Yamada,
	Linux Kbuild mailing list

On Tue, Mar 5, 2019 at 2:50 PM Enrico Weigelt, metux IT consult
<lkml@metux.net> wrote:
>
> On 05.03.19 09:23, Arnd Bergmann wrote:
>
> hmm, if circular deps happen, wouldn't that mean we've got some deeper
> problems in here ? IMHO, dependencies should always form a DAG (except
> for some really rare cases).
>
> Do you recall any actual problem w/ input vs gpio vs. drivers ?
> I'd like to have a closer look at it.

Not with gpio. Most of the circular dependencies I've seen tend to
revolve around drivers/gpu/drm, which uses more 'select' statements
than most other subsystems. Those dependencies often touch
backlight, acpi, fbdev and other things then.

       Arnd

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-05 13:56         ` Andy Shevchenko
@ 2019-03-07  0:10           ` Enrico Weigelt, metux IT consult
  2019-03-07  7:03             ` Darren Hart
  0 siblings, 1 reply; 15+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2019-03-07  0:10 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Arnd Bergmann, Darren Hart, Andy Shevchenko, Linus Walleij,
	Enrico Weigelt, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List, Masahiro Yamada, linux-kbuild

On 05.03.19 14:56, Andy Shevchenko wrote:
> 
> Darren gave a talk about merging kernel configs to get something like
> you want to.
> This tool is quite long already lying around. merge_config.sh in your
> kernel source tree.

Yes, that's similar to how some distros (eg. yocto) do it.

But my requirements are a bit more complex:

In my final meta-config, I just wanna say:

* i have board A (possibly multiple boards)
* i need features X, Y, Z (eg. eth, display, can, ext4, acl, ...)

And that shall be all to generate a minimal config for exactly those
requirements.

Doing that by just putting config snippets together, quickly turns into
a maintenance hell. At least you'd need recursive dependencies and some
if/else logic.

That's why I've written kmct:

https://github.com/metux/kmct


--mtx

-- 
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

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

* Re: [PATCH 2/3] x86: apuv2: fix input dependencies
  2019-03-07  0:10           ` Enrico Weigelt, metux IT consult
@ 2019-03-07  7:03             ` Darren Hart
  0 siblings, 0 replies; 15+ messages in thread
From: Darren Hart @ 2019-03-07  7:03 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult
  Cc: Andy Shevchenko, Arnd Bergmann, Andy Shevchenko, Linus Walleij,
	Enrico Weigelt, open list:GPIO SUBSYSTEM, Platform Driver,
	Linux Kernel Mailing List, Masahiro Yamada, linux-kbuild

On Thu, Mar 07, 2019 at 01:10:13AM +0100, Enrico Weigelt, metux IT consult wrote:
> On 05.03.19 14:56, Andy Shevchenko wrote:
> > 
> > Darren gave a talk about merging kernel configs to get something like
> > you want to.
> > This tool is quite long already lying around. merge_config.sh in your
> > kernel source tree.
> 
> Yes, that's similar to how some distros (eg. yocto) do it.
> 

I wrote merge_config.sh to replace and simplify some of the yocto
tooling. With merge_config upstream, Yocto now uses it directly.

> But my requirements are a bit more complex:
> 
> In my final meta-config, I just wanna say:
> 
> * i have board A (possibly multiple boards)
> * i need features X, Y, Z (eg. eth, display, can, ext4, acl, ...)
> 
> And that shall be all to generate a minimal config for exactly those
> requirements.

That's also the goal of the Yocto configuration fragments, and is
possible with merge_config with a set of defined fragments.

> 
> Doing that by just putting config snippets together, quickly turns into
> a maintenance hell. At least you'd need recursive dependencies and some
> if/else logic.
> 
> That's why I've written kmct:
> 
> https://github.com/metux/kmct

I had a look, the README could benefit from a basic usage example.
Digging through it further, it appears that you are creating yaml files
which contain CONFIGs. The problem with this in my opinion is these are
kernel version specific, so you know have a lot of boiler plate yaml
wrapping kernel version specific CONFIG options which will slowly get
out of sync over time. This is the usual argument for keeping config
fragments together with the kernel - and why we do that in arch/*/config
for example.

Perhaps I'm missing your desired workflow though. I tend to find the
options I need and record them in a fragment, and save it off for later
to quickly be able to "make defconfig fragA.config fragB.config" etc. Is
what you're trying to do different?

-- 
Darren Hart
VMware Open Source Technology Center

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

* Re: [PATCH 3/3] x86: apuv2: select LEDS_CLASS
  2019-03-05  0:09     ` Randy Dunlap
@ 2019-03-08  9:05       ` Linus Walleij
  0 siblings, 0 replies; 15+ messages in thread
From: Linus Walleij @ 2019-03-08  9:05 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Enrico Weigelt, metux IT consult, Arnd Bergmann, Darren Hart,
	Andy Shevchenko, Linus Walleij, Enrico Weigelt, Andy Shevchenko,
	open list:GPIO SUBSYSTEM, platform-driver-x86, linux-kernel

On Tue, Mar 5, 2019 at 1:09 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> On 3/4/19 4:03 PM, Enrico Weigelt, metux IT consult wrote:
> > On 04.03.19 21:19, Arnd Bergmann wrote:
> >> LEDS_GPIO can only be selected when LEDS_CLASS is already enabled:
> >>
> >> WARNING: unmet direct dependencies detected for LEDS_GPIO
> >>   Depends on [m]: NEW_LEDS [=y] && LEDS_CLASS [=m] && (GPIOLIB [=y] || COMPILE_TEST [=y])
> >>   Selected by [y]:
> >>   - PCENGINES_APU2 [=y] && X86 [=y] && X86_PLATFORM_DEVICES [=y] && INPUT_KEYBOARD [=y]
> >>
> >> Fixes: f8eb0235f659 ("x86: pcengines apuv2 gpio/leds/keys platform driver")
> >> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >> ---
> >>  drivers/platform/x86/Kconfig | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> >> index 4d65d37b0c86..d64529352a9c 100644
> >> --- a/drivers/platform/x86/Kconfig
> >> +++ b/drivers/platform/x86/Kconfig
> >> @@ -1308,6 +1308,7 @@ config PCENGINES_APU2
> >>      depends on INPUT && INPUT_KEYBOARD
> >>      select GPIO_AMD_FCH
> >>      select KEYBOARD_GPIO_POLLED
> >> +    select LEDS_CLASS
> >>      select LEDS_GPIO
> >>      help
> >>        This driver provides support for the front button and LEDs on
> >>
> >
> > ACK. Just was about to post the same :)
> >
> > Reviewed-by: Enrico Weigelt, metux It consult <info@metux.net>
> >
>
> Enrico, you were also cc-ed on this patch on Feb.25, 2019:
>
> https://marc.info/?l=linux-kernel&m=155113875310485&w=2

I applied Randy's more extensive patch.

Yours,
Linus Walleij

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

end of thread, other threads:[~2019-03-08  9:05 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 20:19 [PATCH 1/3] x86: apuv2: remove unused variable Arnd Bergmann
2019-03-04 20:19 ` [PATCH 2/3] x86: apuv2: fix input dependencies Arnd Bergmann
2019-03-05  0:18   ` Enrico Weigelt, metux IT consult
2019-03-05  8:23     ` Arnd Bergmann
2019-03-05 13:50       ` Enrico Weigelt, metux IT consult
2019-03-05 13:56         ` Andy Shevchenko
2019-03-07  0:10           ` Enrico Weigelt, metux IT consult
2019-03-07  7:03             ` Darren Hart
2019-03-05 16:46         ` Arnd Bergmann
2019-03-04 20:19 ` [PATCH 3/3] x86: apuv2: select LEDS_CLASS Arnd Bergmann
2019-03-05  0:03   ` Enrico Weigelt, metux IT consult
2019-03-05  0:09     ` Randy Dunlap
2019-03-08  9:05       ` Linus Walleij
2019-03-05  0:04 ` [PATCH 1/3] x86: apuv2: remove unused variable Enrico Weigelt, metux IT consult
2019-03-05 13:47   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).