From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Jani Nikula <jani.nikula@intel.com>,
<linux-kernel@vger.kernel.org>, <dri-devel@lists.freedesktop.org>,
<linuxppc-dev@lists.ozlabs.org>,
<platform-driver-x86@vger.kernel.org>,
<linux-usb@vger.kernel.org>, <linux-fbdev@vger.kernel.org>
Cc: Jingoo Han <jg1.han@samsung.com>, Daniel Drake <dsd@laptop.org>,
Jens Frederich <jfrederich@gmail.com>,
David Airlie <airlied@linux.ie>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jon Nettleton <jon.nettleton@gmail.com>,
Randy Dunlap <rdunlap@infradead.org>,
Lee Jones <lee.jones@linaro.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Darren Hart <dvhart@infradead.org>,
Daniel Vetter <daniel.vetter@intel.com>,
Bryan Wu <cooloney@gmail.com>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Subject: Re: [PATCH] drivers: depend on instead of select BACKLIGHT_CLASS_DEVICE and ACPI_VIDEO
Date: Wed, 22 Oct 2014 11:02:26 +0300 [thread overview]
Message-ID: <54476492.6090105@ti.com> (raw)
In-Reply-To: <1413580403-16225-1-git-send-email-jani.nikula@intel.com>
[-- Attachment #1: Type: text/plain, Size: 3818 bytes --]
On 18/10/14 00:13, Jani Nikula wrote:
> Documentation/kbuild/kconfig-language.txt warns to use select with care,
> and in general use select only for non-visible symbols and for symbols
> with no dependencies, because select will force a symbol to a value
> without visiting the dependencies.
>
> Select has become particularly problematic, interdependently, with the
> BACKLIGHT_CLASS_DEVICE and ACPI_VIDEO configs. For example:
>
> scripts/kconfig/conf --randconfig Kconfig
> KCONFIG_SEED=0x48312B00
> warning: (DRM_RADEON && DRM_NOUVEAU && DRM_I915 && DRM_GMA500 &&
> DRM_SHMOBILE && DRM_TILCDC && FB_BACKLIGHT && FB_MX3 && USB_APPLEDISPLAY
> && FB_OLPC_DCON && ASUS_LAPTOP && SONY_LAPTOP && THINKPAD_ACPI &&
> EEEPC_LAPTOP && ACPI_CMPC && SAMSUNG_Q10) selects BACKLIGHT_CLASS_DEVICE
> which has unmet direct dependencies (HAS_IOMEM && BACKLIGHT_LCD_SUPPORT)
> warning: (DRM_RADEON && DRM_NOUVEAU && DRM_I915 && DRM_GMA500 &&
> DRM_SHMOBILE && DRM_TILCDC && FB_BACKLIGHT && FB_MX3 && USB_APPLEDISPLAY
> && FB_OLPC_DCON && ASUS_LAPTOP && SONY_LAPTOP && THINKPAD_ACPI &&
> EEEPC_LAPTOP && ACPI_CMPC && SAMSUNG_Q10) selects BACKLIGHT_CLASS_DEVICE
> which has unmet direct dependencies (HAS_IOMEM && BACKLIGHT_LCD_SUPPORT)
>
> With tristates it's possible to end up selecting FOO=y depending on
> BAR=m in the config, which gets discovered at build time, not config
> time, like reported in the thread referenced below.
>
> Do the following to fix the dependencies:
>
> * Depend on instead of select BACKLIGHT_CLASS_DEVICE everywhere. Drop
> select BACKLIGHT_LCD_SUPPORT in such cases, as it's a dependency of
> BACKLIGHT_CLASS_DEVICE.
>
> * Remove config FB_BACKLIGHT altogether, and replace it with a
> dependency on BACKLIGHT_CLASS_DEVICE. All configs selecting
> FB_BACKLIGHT select or depend on FB anyway, so we can simplify.
>
> * Depend on (ACPI && ACPI_VIDEO) || ACPI=n in several places instead of
> selecting ACPI_VIDEO and a number of its dependencies if ACPI is
> enabled. This is tied to backlight, as ACPI_VIDEO depends on
> BACKLIGHT_CLASS_DEVICE.
>
> * Replace a couple of select INPUT/VT with depends as it seemed to be
> necessary.
While doing 'depends on' instead of 'select' is an "easy" fix for this,
I do dislike it quite a bit. It's a major pain to go around the kernel
config, trying to find all the dependencies that a particular driver
wants. If I need fb-foobar, I should just be able to enable it, instead
of first searching and selecting its minor dependencies individually.
So, not a NACK, but a "isn't there an another way to fix this?".
Looking at backlight... BACKLIGHT_LCD_SUPPORT seems to be a "meta"
option, it only enables a Kconfig submenu.
So I think we could just remove the whole BACKLIGHT_LCD_SUPPORT option.
But if we do that, all the items in drivers/video/backlight/Kconfig with
default 'y' or 'm' would get enabled by default, so I think we should
remove the 'default's from that file. That makes sense in any case, as I
don't see why "HP Jornada 700 series LCD Driver" should be "default y".
BACKLIGHT_CLASS_DEVICE doesn't depend on anything except
BACKLIGHT_LCD_SUPPORT, so after removing BACKLIGHT_LCD_SUPPORT it should
be safe to 'select' BACKLIGHT_CLASS_DEVICE.
BACKLIGHT_CLASS_DEVICE could be made a hidden option, and the drivers in
drivers/video/backlight/Kconfig which are under BACKLIGHT_CLASS_DEVICE
could be made to select BACKLIGHT_CLASS_DEVICE instead.
That doesn't exactly fix anything, but I think it makes sense as
BACKLIGHT_CLASS_DEVICE is something that's selected from all around the
kernel, so it should be a selectable "library" instead of a Kconfig menu
option.
I didn't look at the ACPI_VIDEO side, so no idea how messy that is.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-10-22 8:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-17 21:13 [PATCH] drivers: depend on instead of select BACKLIGHT_CLASS_DEVICE and ACPI_VIDEO Jani Nikula
2014-10-21 20:50 ` Darren Hart
2014-10-22 8:02 ` Tomi Valkeinen [this message]
2014-10-23 8:10 ` Daniel Vetter
2014-10-23 11:38 ` Tomi Valkeinen
2014-10-27 11:59 ` Jani Nikula
2014-10-27 13:13 ` Tomi Valkeinen
2014-10-28 20:29 ` Randy Dunlap
2014-10-29 3:04 ` Michael Ellerman
2014-10-29 7:54 ` Jani Nikula
2014-10-29 8:27 ` Michael Ellerman
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=54476492.6090105@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=airlied@linux.ie \
--cc=cooloney@gmail.com \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=dsd@laptop.org \
--cc=dvhart@infradead.org \
--cc=gregkh@linuxfoundation.org \
--cc=jani.nikula@intel.com \
--cc=jfrederich@gmail.com \
--cc=jg1.han@samsung.com \
--cc=jon.nettleton@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=plagnioj@jcrosoft.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rdunlap@infradead.org \
/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 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).