linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 09/13] drm: Switch DRM_DISPLAY_DP_AUX_BUS to depends on
       [not found] ` <20240327-kms-kconfig-helpers-v3-9-eafee11b84b3@kernel.org>
@ 2024-04-09  8:35   ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-04-09  8:35 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Jani Nikula, dri-devel, Jani Nikula,
	linux-renesas-soc

 	Hi Maxime,

Thanks for your patch, which is now commit 4d15125d7fe637f4
("drm: Switch DRM_DISPLAY_DP_AUX_BUS to depends on") in
drm/drm-next (next-20240402 and later).

On Wed, 27 Mar 2024, Maxime Ripard wrote:
> Most of our helpers have relied on being selected so far through
> Kconfig, but that creates issues when we have multiple layers of helpers
> with some depending on others.
>
> Indeed, select doesn't select a dependency's dependencies, and thus
> isn't super intuitive. Depends on however doesn't have that limitation,

(Almost?) Everywhere else we fixed that by also selecting the
dependencies, which is more user-friendly.

> so we can just switch all the drivers that were selecting
> DRM_DISPLAY_DP_AUX_BUS to depend on it.
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Maxime Ripard <mripard@kernel.org>

> --- a/drivers/gpu/drm/display/Kconfig
> +++ b/drivers/gpu/drm/display/Kconfig
> @@ -9,10 +9,11 @@ config DRM_DISPLAY_HELPER
>
> config DRM_DISPLAY_DP_AUX_BUS
> 	tristate "DRM DisplayPort AUX bus support"
> 	depends on DRM
> 	depends on OF || COMPILE_TEST
> +	default y

(quoting Linus) "What is so special about your driver, that it needs to
default to enabled?".

Especially as there is no help available for this option, so the casual
user has no idea if this is needed or not.

And a general comment for this series: many defconfigs need to be
updated, as drivers are no longer enabled because they need
functionality that now needs to be enabled explicitly.

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] 7+ messages in thread

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
       [not found] <20240327-kms-kconfig-helpers-v3-0-eafee11b84b3@kernel.org>
       [not found] ` <20240327-kms-kconfig-helpers-v3-9-eafee11b84b3@kernel.org>
@ 2024-04-09  9:26 ` Geert Uytterhoeven
  2024-04-09 10:04   ` Jani Nikula
  2024-04-10 19:46   ` Diederik de Haas
  1 sibling, 2 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-04-09  9:26 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Jani Nikula, dri-devel, Jani Nikula,
	Lucas De Marchi, kernel test robot, linux-renesas-soc,
	linux-arm-kernel

 	Hi Maxime,

On Wed, 27 Mar 2024, Maxime Ripard wrote:
> Jani recently pointed out that the Kconfig symbols are a bit difficult
> to work with at the moment when they depend on each other, and that
> using depends on would be a better idea, but no one really did the work
> so far.
>
> So here it goes :)
>
> It's been tested by comparing the riscv defconfig, arm
> multi_v7_defconfig, arm64 defconfig, drm-misc-arm, drm-misc-arm64 and
> drm-misc-x86 before and after this series and making sure they are
> identical.

That is not true: comparing drm-misc/for-linux-next to v6.9-rc2,
arm/multi_v7_defconfig, arm64/defconfig, and riscv/defconfig lost
several of:
   - CONFIG_DRM_DW_HDMI,
   - CONFIG_DRM_DW_HDMI_AHB_AUDIO,
   - CONFIG_DRM_DW_HDMI_CEC,
   - CONFIG_DRM_DW_HDMI_I2S_AUDIO,
   - CONFIG_DRM_IMX_HDMI.
   - CONFIG_DRM_MESON_DW_HDMI,
   - CONFIG_DRM_RCAR_DW_HDMI,
   - CONFIG_DRM_SUN8I_DW_HDMI,
   - CONFIG_ROCKCHIP_DW_HDMI,
   - CONFIG_SND_MESON_G12A_TOHDMITX,

> Let me know what you think,

IMHO this series looks like a big usuability issue for anyone
configuring the kernel, and you try to work around this by sprinkling
"default y" around.

The user should not need to know which helpers are needed for the driver
he is interested in.  When a symbol selects another symbol, it should
just make sure the dependencies of the target symbol are met.

Thanks for reverting ;-)

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] 7+ messages in thread

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
  2024-04-09  9:26 ` [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols " Geert Uytterhoeven
@ 2024-04-09 10:04   ` Jani Nikula
  2024-04-09 10:35     ` Geert Uytterhoeven
  2024-04-10 19:46   ` Diederik de Haas
  1 sibling, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2024-04-09 10:04 UTC (permalink / raw)
  To: Geert Uytterhoeven, Maxime Ripard
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Daniel Vetter, dri-devel, Lucas De Marchi, kernel test robot,
	linux-renesas-soc, linux-arm-kernel

On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> The user should not need to know which helpers are needed for the driver
> he is interested in.  When a symbol selects another symbol, it should
> just make sure the dependencies of the target symbol are met.

It's really not "just make sure". This leads to perpetual illegal
configurations, and duct tape fixes. Select should not be used for
visible symbols or symbols with dependencies [1].

What we'd need for usability is not more abuse of select, but rather 1)
warnings for selecting symbols with dependencies, and 2) a way to enable
a kconfig option with all its dependencies, recursively. This is what we
lack.


BR,
Jani.


[1] Documentation/kbuild/kconfig-language.rst "reverse dependencies"


-- 
Jani Nikula, Intel

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

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
  2024-04-09 10:04   ` Jani Nikula
@ 2024-04-09 10:35     ` Geert Uytterhoeven
  2024-04-09 11:12       ` Jani Nikula
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-04-09 10:35 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, Lucas De Marchi,
	kernel test robot, linux-renesas-soc, linux-arm-kernel,
	linux-kbuild

Hi Jani,

On Tue, Apr 9, 2024 at 12:04 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > The user should not need to know which helpers are needed for the driver
> > he is interested in.  When a symbol selects another symbol, it should
> > just make sure the dependencies of the target symbol are met.
>
> It's really not "just make sure". This leads to perpetual illegal
> configurations, and duct tape fixes. Select should not be used for
> visible symbols or symbols with dependencies [1].

In other words: none of these helpers should be visible...

> What we'd need for usability is not more abuse of select, but rather 1)
> warnings for selecting symbols with dependencies, and 2) a way to enable

Kconfig already warns if dependencies of selected symbols are not met.

> a kconfig option with all its dependencies, recursively. This is what we
> lack.

You cannot force-enable all dependencies of the target symbol, as some
of these dependencies may be impossible to meet on the system you are
configuring a kernel for.

The current proper way is to add these dependencies to the source
symbol, which is what we have been doing everywhere else.  Another
solution may be to teach Kconfig to ignore any symbols that select a
symbol with unmet dependencies.

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] 7+ messages in thread

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
  2024-04-09 10:35     ` Geert Uytterhoeven
@ 2024-04-09 11:12       ` Jani Nikula
  2024-04-09 15:24         ` Geert Uytterhoeven
  0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2024-04-09 11:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, Lucas De Marchi,
	kernel test robot, linux-renesas-soc, linux-arm-kernel,
	linux-kbuild

On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> Hi Jani,
>
> On Tue, Apr 9, 2024 at 12:04 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>> On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> > The user should not need to know which helpers are needed for the driver
>> > he is interested in.  When a symbol selects another symbol, it should
>> > just make sure the dependencies of the target symbol are met.
>>
>> It's really not "just make sure". This leads to perpetual illegal
>> configurations, and duct tape fixes. Select should not be used for
>> visible symbols or symbols with dependencies [1].
>
> In other words: none of these helpers should be visible...

...and should have no dependencies? :p

>
>> What we'd need for usability is not more abuse of select, but rather 1)
>> warnings for selecting symbols with dependencies, and 2) a way to enable
>
> Kconfig already warns if dependencies of selected symbols are not met.

But it does lead to cases where a builtin tries to use a symbol from a
module, failing at link time, not config time. Then I regularly see
patches trying to fix this with IS_REACHABLE(), making it a silent
runtime failure instead, when it should've been a config issue.

>> a kconfig option with all its dependencies, recursively. This is what we
>> lack.
>
> You cannot force-enable all dependencies of the target symbol, as some
> of these dependencies may be impossible to meet on the system you are
> configuring a kernel for.

Surely kconfig should be able to figure out if they're possible or not.

> The current proper way is to add these dependencies to the source
> symbol, which is what we have been doing everywhere else.  Another
> solution may be to teach Kconfig to ignore any symbols that select a
> symbol with unmet dependencies.

...

It seems like your main argument in favour of using select is that it's
more convenient for people who configure the kernel. Because the user
should be able to just enable a driver, and that would select everything
that's needed. But where do we draw the line? Then what qualifies for
"depends on"?

Look at config DRM_I915 and where select abuse has lead us. Like, why
don't we just select DRM, PCI and X86 as well instead of depend. :p

A lot of things we have to select because it appears to generally be the
case that if some places select and some places depends on a symbol,
it'll lead to circular dependencies.

Sure there may be a usability issue with using depends on. But the
proper fix isn't hacking in kconfig files, it's to fix the usability in
kconfig the tool UI. But nobody steps up, because at least I find the
kconfig source to be inpenetrable. I've tried many times, and given up.

I mean, if you want to enable a driver D, it could, at a minimum, show
you a tree of (possibly alternative) things you also need to enable. But
if the dependencies aren't there, you won't even see the config for
D. That's not something that should be "fixed" by abusing select in
kconfig files.


BR,
Jani.


-- 
Jani Nikula, Intel

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

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
  2024-04-09 11:12       ` Jani Nikula
@ 2024-04-09 15:24         ` Geert Uytterhoeven
  0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2024-04-09 15:24 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Maxime Ripard, Maarten Lankhorst, Thomas Zimmermann,
	David Airlie, Daniel Vetter, dri-devel, Lucas De Marchi,
	kernel test robot, linux-renesas-soc, linux-arm-kernel,
	linux-kbuild

Hi Jani,

On Tue, Apr 9, 2024 at 1:13 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > On Tue, Apr 9, 2024 at 12:04 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
> >> On Tue, 09 Apr 2024, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> >> > The user should not need to know which helpers are needed for the driver
> >> > he is interested in.  When a symbol selects another symbol, it should
> >> > just make sure the dependencies of the target symbol are met.
> >>
> >> It's really not "just make sure". This leads to perpetual illegal
> >> configurations, and duct tape fixes. Select should not be used for
> >> visible symbols or symbols with dependencies [1].
> >
> > In other words: none of these helpers should be visible...
>
> ...and should have no dependencies? :p

Unless they do have dependencies.

> >> What we'd need for usability is not more abuse of select, but rather 1)
> >> warnings for selecting symbols with dependencies, and 2) a way to enable
> >
> > Kconfig already warns if dependencies of selected symbols are not met.
>
> But it does lead to cases where a builtin tries to use a symbol from a
> module, failing at link time, not config time. Then I regularly see
> patches trying to fix this with IS_REACHABLE(), making it a silent
> runtime failure instead, when it should've been a config issue.

If a symbol for a builtin selects a symbol for a module, the latter
becomes builtin, too, so that does not cause such issues?
You can get such issues when a boolean symbol depends on a tristate
symbol...

> >> a kconfig option with all its dependencies, recursively. This is what we
> >> lack.
> >
> > You cannot force-enable all dependencies of the target symbol, as some
> > of these dependencies may be impossible to meet on the system you are
> > configuring a kernel for.
>
> Surely kconfig should be able to figure out if they're possible or not.
>
> > The current proper way is to add these dependencies to the source
> > symbol, which is what we have been doing everywhere else.  Another
> > solution may be to teach Kconfig to ignore any symbols that select a
> > symbol with unmet dependencies.
>
> ...
>
> It seems like your main argument in favour of using select is that it's
> more convenient for people who configure the kernel. Because the user
> should be able to just enable a driver, and that would select everything
> that's needed. But where do we draw the line? Then what qualifies for
> "depends on"?

Hard (platform and subsystem) dependencies.

> Look at config DRM_I915 and where select abuse has lead us. Like, why
> don't we just select DRM, PCI and X86 as well instead of depend. :p

X86 and PCI are hard platform dependencies.
DRM is a subsystem dependency.

> A lot of things we have to select because it appears to generally be the
> case that if some places select and some places depends on a symbol,
> it'll lead to circular dependencies.

True.  So all library code (incl. helpers) should be selected, and
not be used as a dependency.
The user shouldn't be aware that the driver uses library code (or not).

> Sure there may be a usability issue with using depends on. But the
> proper fix isn't hacking in kconfig files, it's to fix the usability in
> kconfig the tool UI. But nobody steps up, because at least I find the
> kconfig source to be inpenetrable. I've tried many times, and given up.

As long as Kconfig does not handle dependencies of selected symbols
automatically, adding explicit dependencies to the origin symbols is
the only workable solution.

> I mean, if you want to enable a driver D, it could, at a minimum, show
> you a tree of (possibly alternative) things you also need to enable. But

And this series is actually making that harder, by turning all these
selects of helpers into dependencies...

> if the dependencies aren't there, you won't even see the config for
> D. That's not something that should be "fixed" by abusing select in
> kconfig files.

I consider not seeing symbols when a hard dependency is not met as
a good thing.  If everything was visible all the time, you would
have a very hard (well, harder than the current already-hard ;-)
time configuring your kernel.

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] 7+ messages in thread

* Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
  2024-04-09  9:26 ` [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols " Geert Uytterhoeven
  2024-04-09 10:04   ` Jani Nikula
@ 2024-04-10 19:46   ` Diederik de Haas
  1 sibling, 0 replies; 7+ messages in thread
From: Diederik de Haas @ 2024-04-10 19:46 UTC (permalink / raw)
  To: Maxime Ripard, Geert Uytterhoeven
  Cc: Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Daniel Vetter, Jani Nikula, dri-devel, Jani Nikula,
	Lucas De Marchi, kernel test robot, linux-renesas-soc,
	linux-arm-kernel

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

On Tuesday, 9 April 2024 11:26:25 CEST Geert Uytterhoeven wrote:
>  	Hi Maxime,
> 
> On Wed, 27 Mar 2024, Maxime Ripard wrote:
> > Jani recently pointed out that the Kconfig symbols are a bit difficult
> > to work with at the moment when they depend on each other, and that
> > using depends on would be a better idea, but no one really did the work
> > so far.
> > 
> > So here it goes :)
> > 
> > It's been tested by comparing the riscv defconfig, arm
> > multi_v7_defconfig, arm64 defconfig, drm-misc-arm, drm-misc-arm64 and
> > drm-misc-x86 before and after this series and making sure they are
> > identical.
> 
> That is not true: comparing drm-misc/for-linux-next to v6.9-rc2,
> arm/multi_v7_defconfig, arm64/defconfig, and riscv/defconfig lost
> several of:
>    - CONFIG_DRM_DW_HDMI,
>    - CONFIG_DRM_DW_HDMI_AHB_AUDIO,
>    - CONFIG_DRM_DW_HDMI_CEC,
>    - CONFIG_DRM_DW_HDMI_I2S_AUDIO,
>    - CONFIG_DRM_IMX_HDMI.
>    - CONFIG_DRM_MESON_DW_HDMI,
>    - CONFIG_DRM_RCAR_DW_HDMI,
>    - CONFIG_DRM_SUN8I_DW_HDMI,
>    - CONFIG_ROCKCHIP_DW_HDMI,
>    - CONFIG_SND_MESON_G12A_TOHDMITX,
> 
> > Let me know what you think,
> 
> IMHO this series looks like a big usuability issue for anyone
> configuring the kernel, and you try to work around this by sprinkling
> "default y" around.
> 
> The user should not need to know which helpers are needed for the driver
> he is interested in.  When a symbol selects another symbol, it should
> just make sure the dependencies of the target symbol are met.
> 
> Thanks for reverting ;-)

I *think* that I ran into this issue (but it may also be KEBKAC).
I tried to build a Debian arm64 kernel from 6.9-rc3 with a number of drm-misc-
next patches, including this patch set.

debian/config/arm64/config: CONFIG_DRM_SUN8I_DW_HDMI=m

In my 6.7.9 kernel the sun8i-drm-hdmi module got build.
(as well as meson_dw_hdmi, although it does not have an explicit configuration 
for it, but there appears a similarity with it in the `drm: Make drivers 
depends on DRM_DW_HDMI` commit)

But in my newly build kernel both are NOT build.
While I can't complain about meson_dw_hdmi, I would have expected the sun8i-
drm-hdmi module to be build.

Cheers,
  Diederik

PS: The Kconfig says that the module will be called `sun8i_dw_hdmi`, but that 
seems to be incorrect

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2024-04-10 19:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240327-kms-kconfig-helpers-v3-0-eafee11b84b3@kernel.org>
     [not found] ` <20240327-kms-kconfig-helpers-v3-9-eafee11b84b3@kernel.org>
2024-04-09  8:35   ` [PATCH v3 09/13] drm: Switch DRM_DISPLAY_DP_AUX_BUS to depends on Geert Uytterhoeven
2024-04-09  9:26 ` [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols " Geert Uytterhoeven
2024-04-09 10:04   ` Jani Nikula
2024-04-09 10:35     ` Geert Uytterhoeven
2024-04-09 11:12       ` Jani Nikula
2024-04-09 15:24         ` Geert Uytterhoeven
2024-04-10 19:46   ` Diederik de Haas

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).