All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Maxime Ripard <mripard@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	kernel test robot <lkp@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
Date: Tue, 09 Apr 2024 14:12:59 +0300	[thread overview]
Message-ID: <87edbe94ck.fsf@intel.com> (raw)
In-Reply-To: <CAMuHMdVMhXFm-kZ50Un1ZFmEcjJ7SnpyEyw65-wucBGpVRUFww@mail.gmail.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Maxime Ripard <mripard@kernel.org>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>,
	kernel test robot <lkp@intel.com>,
	linux-renesas-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on
Date: Tue, 09 Apr 2024 14:12:59 +0300	[thread overview]
Message-ID: <87edbe94ck.fsf@intel.com> (raw)
In-Reply-To: <CAMuHMdVMhXFm-kZ50Un1ZFmEcjJ7SnpyEyw65-wucBGpVRUFww@mail.gmail.com>

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

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

  reply	other threads:[~2024-04-09 11:13 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 10:56 [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on Maxime Ripard
2024-03-27 10:56 ` [PATCH v3 01/13] drm/display: Make DisplayPort AUX bus Kconfig name consistent Maxime Ripard
2024-03-27 10:56 ` [PATCH v3 02/13] drm/display: Make DisplayPort tunnel debug " Maxime Ripard
2024-03-27 10:56 ` [PATCH v3 03/13] drm/display: Make DisplayPort AUX Chardev " Maxime Ripard
2024-03-27 10:56 ` [PATCH v3 04/13] drm/display: Make DisplayPort CEC-over-AUX " Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 05/13] drm/display: Reorder Kconfig symbols Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 06/13] drm/display: Make all helpers visible and switch to depends on Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 07/13] drm: Make drivers depends on DRM_DW_HDMI Maxime Ripard
2024-03-28 10:01   ` Jani Nikula
2024-04-02 15:43   ` Mark Brown
2024-04-03  6:50     ` Alexander Stein
2024-04-23  5:45     ` Mark Brown
2024-04-23  8:05       ` Jani Nikula
2024-03-27 10:57 ` [PATCH v3 08/13] drm: Switch DRM_DISPLAY_HELPER to depends on Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 09/13] drm: Switch DRM_DISPLAY_DP_AUX_BUS " Maxime Ripard
2024-04-09  8:35   ` Geert Uytterhoeven
2024-03-27 10:57 ` [PATCH v3 10/13] drm: Switch DRM_DISPLAY_DP_HELPER " Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 11/13] drm: Switch DRM_DISPLAY_HDCP_HELPER " Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 12/13] drm: Switch DRM_DISPLAY_HDMI_HELPER " Maxime Ripard
2024-03-27 10:57 ` [PATCH v3 13/13] drm/bridge: it6505: Remove useless select Maxime Ripard
2024-03-28 10:29 ` [PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to depends on Maxime Ripard
2024-04-09  9:26 ` Geert Uytterhoeven
2024-04-09  9:26   ` Geert Uytterhoeven
2024-04-09 10:04   ` Jani Nikula
2024-04-09 10:04     ` Jani Nikula
2024-04-09 10:35     ` Geert Uytterhoeven
2024-04-09 10:35       ` Geert Uytterhoeven
2024-04-09 11:12       ` Jani Nikula [this message]
2024-04-09 11:12         ` Jani Nikula
2024-04-09 15:24         ` Geert Uytterhoeven
2024-04-09 15:24           ` Geert Uytterhoeven
2024-04-10 19:46   ` Diederik de Haas
2024-04-10 19:46     ` Diederik de Haas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87edbe94ck.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.