All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Arnd Bergmann <arnd@arndb.de>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Dave Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 00/11] drm: Restore helper usability
Date: Mon, 22 Apr 2024 16:28:21 +0300	[thread overview]
Message-ID: <875xw9ttl6.fsf@intel.com> (raw)
In-Reply-To: <ff4f9e8f-0825-4421-adf9-e3914b108da7@app.fastmail.com>

On Mon, 22 Apr 2024, "Arnd Bergmann" <arnd@arndb.de> wrote:
> On Mon, Apr 22, 2024, at 13:50, Jani Nikula wrote:
>> On Mon, 22 Apr 2024, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>>> 	Hi all,
>>>
>>> As discussed on IRC with Maxime and Arnd, this series reverts the
>>> conversion of select to depends for various DRM helpers in series
>>> "[PATCH v3 00/13] drm/display: Convert helpers Kconfig symbols to
>>> depends on"[1], and various fixes for it.  This conversion introduced a
>>> big usability issue when configuring a kernel and enabling DRM drivers
>>> that use DRM helper code: as drivers now depend on helpers, the user
>>> needs to know which helpers to enable, before the driver he is
>>> interested even becomes visible.  The user should not need to know that,
>>> and drivers should select the helpers they need.
>>>
>>> Hence revert back to what we had before, where drivers selected the
>>> helpers (and any of their dependencies, if they can be met) they need.
>>> In general, when a symbol selects another symbol, it should just make
>>> sure the dependencies of the target symbol are met, which may mean
>>> adding dependencies to the source symbol.
>
> Thanks for doing this.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
>> I still disagree with this, because fundamentally the source symbol
>> really should not have to care about the dependencies of the target
>> symbol.
>
> Sorry you missed the IRC discussion on #armlinux, we should have
> included you as well since you applied the original patch.
>
> I think the reason for this revert is a bit more nuanced than
> just the usability problem. Sorry if I'm dragging this out too
> much, but I want to be sure that two points come across:
>
> 1. There is a semantic problem that is mostly subjective, but
>    with the naming as "helper", I generally expect it as a hidden
>    symbol that gets selected by its users, while calling same module
>    "feature" would be something that is user-enabled and that
>    other modules depend on. Both ways are commonly used in the
>    kernel and are not mistakes on their own.

Fair enough. I believe for (optional) "feature" the common pattern would
then be depends on FEATURE || FEATURE=n.

> 2. Using "select" on user visible symbols that have dependencies
>    is a common source for bugs, and this is is a problem in
>    drivers/gpu/drm more than elsewhere in the kernel, as these
>    drivers traditionally select entire subsystems or drivers
>    (I2C, VIRTIO, INPUT, ACPI_WMI, BACKLIGHT_CLASS_DEVICE,
>    POWER_SUPPLY, SND_PCM, INTERCONNECT, ...). This regularly
>    leads to circular dependencies and we should fix all of them.

What annoys me is that the fixes tend to fall in two categories:

- Play catch with selecting the dependencies of the selected
  symbols. "depends on" handles this recursively, while select does
  not. There is no end to this, it just goes on and on, as the
  dependencies of the selected symbols change over time. Often the
  selects require unintuitive if patterns that are about the
  implementation details of the symbol being selected.

- Brush the invalid configs under the rug by using IS_REACHABLE(),
  switching from a loud link time failure to a silent runtime
  failure. (I regularly reject patches adding IS_REACHABLE() to i915,
  because from my pov e.g. i915=y backlight=m is an invalid
  configuration that the user shouldn't have to debug at runtime. But I
  can't express that in kconfig while everyone selects backlight.)

If you have other ideas how these should be fixed, I'm all ears.

>    The display helpers however don't have this problem because
>    they do not have any dependencies outside of drivers/gpu/

Fair enough, though I think they still suffer from some of them having
dependencies. (Wasn't this how the original patches and the debate all
got started?)


BR,
Jani.


-- 
Jani Nikula, Intel

  reply	other threads:[~2024-04-22 13:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22 10:30 [PATCH 00/11] drm: Restore helper usability Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 01/11] Revert "drm: fix DRM_DISPLAY_DP_HELPER dependencies, part 2" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 02/11] Revert "drm/display: Select DRM_KMS_HELPER for DP helpers" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 03/11] Revert "drm/bridge: dw-hdmi: Make DRM_DW_HDMI selectable" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 04/11] Revert "drm: fix DRM_DISPLAY_DP_HELPER dependencies" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 05/11] Revert "drm: Switch DRM_DISPLAY_HDMI_HELPER to depends on" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 06/11] Revert "drm: Switch DRM_DISPLAY_HDCP_HELPER " Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 07/11] Revert "drm: Switch DRM_DISPLAY_DP_HELPER " Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 08/11] Revert "drm: Switch DRM_DISPLAY_DP_AUX_BUS " Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 09/11] Revert "drm: Switch DRM_DISPLAY_HELPER " Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 10/11] Revert "drm: Make drivers depends on DRM_DW_HDMI" Geert Uytterhoeven
2024-04-22 10:30 ` [PATCH 11/11] Revert "drm/display: Make all helpers visible and switch to depends on" Geert Uytterhoeven
2024-04-22 11:50 ` [PATCH 00/11] drm: Restore helper usability Jani Nikula
2024-04-22 12:27   ` Dmitry Baryshkov
2024-04-22 12:30   ` Arnd Bergmann
2024-04-22 13:28     ` Jani Nikula [this message]
2024-04-22 13:54       ` Arnd Bergmann
2024-04-22 16:58         ` Geert Uytterhoeven
2024-04-22 17:14           ` Jani Nikula
2024-04-22 18:02             ` Geert Uytterhoeven
2024-04-22 18:23           ` Arnd Bergmann
2024-04-22 19:42             ` Masahiro Yamada
2024-04-22 20:46               ` Arnd Bergmann
2024-04-22 17:00         ` Jani Nikula
2024-04-22 18:11           ` Geert Uytterhoeven

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=875xw9ttl6.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@gmail.com \
    --cc=arnd@arndb.de \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --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.