mbox series

[0/3] Kconfig dependencies: acpi-video, backlight and thermal

Message ID 20170726135312.2214309-1-arnd@arndb.de
Headers show
Series Kconfig dependencies: acpi-video, backlight and thermal | expand

Message

Arnd Bergmann July 26, 2017, 1:53 p.m. UTC
Hi everyone,

It took me a while to figure this out properly, as I kept getting
circular or missing dependencies with video drivers.

This set of three patches should simplify the situation a bit,
mostly by cleaning up the dependencies around CONFIG_ACPI_VIDEO.
With all three patches applied, I no longer run into those related
warnings. If everyone agrees on the general direction, I hope
we can merge all three through the DRM tree.

I originally had another larger patch in the series to replace all
of the 'select BACKLIGHT_LCD_SUPPORT; select BACKLIGHT_CLASS_DEVICE'
statements with 'depends on LCD_CLASS_DEVICE', that would clean
it up some more, but it is also a more invasive change that we
can do separately at some point.

       Arnd

Arnd Bergmann (3):
  backlight: always select BACKLIGHT_LCD_SUPPORT for
    BACKLIGHT_CLASS_DEVICE
  ACPI/DRM: rework ACPI_VIDEO Kconfig dependencies
  drm/etnaviv: add thermal dependency

 drivers/acpi/Kconfig              |  7 +++++--
 drivers/gpu/drm/etnaviv/Kconfig   |  1 +
 drivers/gpu/drm/gma500/Kconfig    |  5 +----
 drivers/gpu/drm/i915/Kconfig      |  7 +------
 drivers/gpu/drm/nouveau/Kconfig   | 10 ++--------
 drivers/platform/x86/Kconfig      |  9 ++++-----
 drivers/staging/olpc_dcon/Kconfig |  1 +
 7 files changed, 15 insertions(+), 25 deletions(-)

To: dri-devel@lists.freedesktop.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Russell King <linux+etnaviv@armlinux.org.uk>
Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: Andy Shevchenko <andy@infradead.org>
Cc: Jens Frederich <jfrederich@gmail.com>
Cc: Daniel Drake <dsd@laptop.org>
Cc: Jon Nettleton <jon.nettleton@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-acpi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: etnaviv@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: platform-driver-x86@vger.kernel.org
Cc: devel@driverdev.osuosl.org

Comments

Lucas Stach Aug. 8, 2017, 11:16 a.m. UTC | #1
Hi Arnd,

Am Mittwoch, den 26.07.2017, 15:53 +0200 schrieb Arnd Bergmann:
> When CONFIG_THERMAL is enabled as a loadable module, and etnaviv is
> built-in, we get a link error:
> 
> drivers/gpu/drm/etnaviv/etnaviv_gpu.o: In function `etnaviv_gpu_bind':
> etnaviv_gpu.c:(.text.etnaviv_gpu_bind+0x34): undefined reference to `thermal_of_cooling_device_register'
> etnaviv_gpu.c:(.text.etnaviv_gpu_bind+0xe0): undefined reference to `thermal_cooling_device_unregister'
> drivers/gpu/drm/etnaviv/etnaviv_gpu.o: In function `etnaviv_gpu_unbind':
> etnaviv_gpu.c:(.text.etnaviv_gpu_unbind+0xf0): undefined reference to `thermal_cooling_device_unregister'
> 
> This adds a Kconfig dependency to prevent etnaviv from being built-in
> with CONFIG_THERMAL=m, while still allowing the valid configurations.
> Unfortunately, simply adding the dependency here breaks Kconfig through
> a dependency loop involving lots of symbols all the way until ACPI_VIDEO,
> which is the only video driver that explicitly selects 'THERMAL'. Turning
> this into a 'depends on' addresses the problem.
> For completeness, I'm also removing the redundant 'select THERMAL'
> from INTEL_MENLOW, so no other driver uses that statement.
> 
> Fixes: bcdfb5e56dc5 ("drm/etnaviv: add etnaviv cooling device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> v2: spend more thought on ACPI_VIDEO dependencies, as we need another
>     patch before this.
> ---
>  drivers/acpi/Kconfig            | 2 +-
>  drivers/gpu/drm/etnaviv/Kconfig | 1 +
>  drivers/platform/x86/Kconfig    | 1 -

I would like to take this patch, but I'm not sure why it includes x86
and ACPI hunks.

Regards,
Lucas

>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index a8f5a40e2914..1282b2936164 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -184,7 +184,7 @@ config ACPI_VIDEO
>  	tristate "Video"
>  	depends on X86
>  	depends on INPUT
> -	select THERMAL
> +	depends on THERMAL
>  	select BACKLIGHT_CLASS_DEVICE
>  	select BACKLIGHT_LCD_SUPPORT
>  	default y
> diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig
> index 71cee4e9fefb..1d6c744e7924 100644
> --- a/drivers/gpu/drm/etnaviv/Kconfig
> +++ b/drivers/gpu/drm/etnaviv/Kconfig
> @@ -3,6 +3,7 @@ config DRM_ETNAVIV
>  	tristate "ETNAVIV (DRM support for Vivante GPU IP cores)"
>  	depends on DRM
>  	depends on ARCH_MXC || ARCH_DOVE || (ARM && COMPILE_TEST)
> +	depends on THERMAL || THERMAL=n
>  	depends on MMU
>  	select SHMEM
>  	select SYNC_FILE
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 2d9fb46a8d11..d9238e9ff54a 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -532,7 +532,6 @@ config SENSORS_HDAPS
>  config INTEL_MENLOW
>  	tristate "Thermal Management driver for Intel menlow platform"
>  	depends on ACPI_THERMAL
> -	select THERMAL
>  	---help---
>  	  ACPI thermal management enhancement driver on
>  	  Intel Menlow platform.