All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/etnaviv: add thermal dependency
@ 2017-04-19 18:11 ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2017-04-19 18:11 UTC (permalink / raw)
  To: Lucas Stach, David Airlie
  Cc: Arnd Bergmann, linux-pm, Sujith Thomas, Daniel Vetter,
	Rafael J. Wysocki, linux-kernel, dri-devel, etnaviv,
	Eduardo Valentin, linux-acpi, Russell King, Darren Hart,
	Zhang Rui, platform-driver-x86, Andy Shevchenko, Len Brown

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>
---
 drivers/acpi/Kconfig            | 2 +-
 drivers/gpu/drm/etnaviv/Kconfig | 1 +
 drivers/platform/x86/Kconfig    | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 03cc4e74096b..252399efa8b3 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -184,7 +184,7 @@ config ACPI_VIDEO
 	tristate "Video"
 	depends on X86 && BACKLIGHT_CLASS_DEVICE
 	depends on INPUT
-	select THERMAL
+	depends on THERMAL
 	help
 	  This driver implements the ACPI Extensions For Display Adapters
 	  for integrated graphics devices on motherboard, as specified in
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 e229ea317b9c..76ced87efde5 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -544,7 +544,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.
-- 
2.9.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/etnaviv: add thermal dependency
@ 2017-04-19 18:11 ` Arnd Bergmann
  0 siblings, 0 replies; 9+ messages in thread
From: Arnd Bergmann @ 2017-04-19 18:11 UTC (permalink / raw)
  To: Lucas Stach, David Airlie
  Cc: Zhang Rui, Eduardo Valentin, linux-pm, Sujith Thomas,
	Arnd Bergmann, Rafael J. Wysocki, Len Brown, Russell King,
	Christian Gmeiner, Darren Hart, Andy Shevchenko, Daniel Vetter,
	linux-acpi, linux-kernel, etnaviv, dri-devel, platform-driver-x86

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>
---
 drivers/acpi/Kconfig            | 2 +-
 drivers/gpu/drm/etnaviv/Kconfig | 1 +
 drivers/platform/x86/Kconfig    | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 03cc4e74096b..252399efa8b3 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -184,7 +184,7 @@ config ACPI_VIDEO
 	tristate "Video"
 	depends on X86 && BACKLIGHT_CLASS_DEVICE
 	depends on INPUT
-	select THERMAL
+	depends on THERMAL
 	help
 	  This driver implements the ACPI Extensions For Display Adapters
 	  for integrated graphics devices on motherboard, as specified in
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 e229ea317b9c..76ced87efde5 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -544,7 +544,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.
-- 
2.9.0

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
  2017-04-19 18:11 ` Arnd Bergmann
@ 2017-04-19 18:58   ` Andy Shevchenko
  -1 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-19 18:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Platform Driver, linux-pm@vger.kernel.org, Sujith Thomas,
	Daniel Vetter, Rafael J. Wysocki, linux-kernel@vger.kernel.org,
	dri-devel, etnaviv, Eduardo Valentin, linux-acpi@vger.kernel.org,
	Russell King, Darren Hart, Zhang Rui, Len Brown, Andy Shevchenko

On Wed, Apr 19, 2017 at 9:11 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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.
>

For PDx86 part:

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Fixes: bcdfb5e56dc5 ("drm/etnaviv: add etnaviv cooling device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/acpi/Kconfig            | 2 +-
>  drivers/gpu/drm/etnaviv/Kconfig | 1 +
>  drivers/platform/x86/Kconfig    | 1 -
>  3 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 03cc4e74096b..252399efa8b3 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -184,7 +184,7 @@ config ACPI_VIDEO
>         tristate "Video"
>         depends on X86 && BACKLIGHT_CLASS_DEVICE
>         depends on INPUT
> -       select THERMAL
> +       depends on THERMAL
>         help
>           This driver implements the ACPI Extensions For Display Adapters
>           for integrated graphics devices on motherboard, as specified in
> 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 e229ea317b9c..76ced87efde5 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -544,7 +544,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.
> --
> 2.9.0
>



-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
@ 2017-04-19 18:58   ` Andy Shevchenko
  0 siblings, 0 replies; 9+ messages in thread
From: Andy Shevchenko @ 2017-04-19 18:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lucas Stach, David Airlie, Zhang Rui, Eduardo Valentin,
	linux-pm@vger.kernel.org, Sujith Thomas, Rafael J. Wysocki,
	Len Brown, Russell King, Christian Gmeiner, Darren Hart,
	Andy Shevchenko, Daniel Vetter, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, etnaviv, dri-devel, Platform Driver

On Wed, Apr 19, 2017 at 9:11 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> 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.
>

For PDx86 part:

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Fixes: bcdfb5e56dc5 ("drm/etnaviv: add etnaviv cooling device")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/acpi/Kconfig            | 2 +-
>  drivers/gpu/drm/etnaviv/Kconfig | 1 +
>  drivers/platform/x86/Kconfig    | 1 -
>  3 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 03cc4e74096b..252399efa8b3 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -184,7 +184,7 @@ config ACPI_VIDEO
>         tristate "Video"
>         depends on X86 && BACKLIGHT_CLASS_DEVICE
>         depends on INPUT
> -       select THERMAL
> +       depends on THERMAL
>         help
>           This driver implements the ACPI Extensions For Display Adapters
>           for integrated graphics devices on motherboard, as specified in
> 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 e229ea317b9c..76ced87efde5 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -544,7 +544,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.
> --
> 2.9.0
>



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
  2017-04-19 18:11 ` Arnd Bergmann
  (?)
  (?)
@ 2017-04-23 15:36 ` Eduardo Valentin
  -1 siblings, 0 replies; 9+ messages in thread
From: Eduardo Valentin @ 2017-04-23 15:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lucas Stach, David Airlie, Zhang Rui, linux-pm, Sujith Thomas,
	Rafael J. Wysocki, Len Brown, Russell King, Christian Gmeiner,
	Darren Hart, Andy Shevchenko, Daniel Vetter, linux-acpi,
	linux-kernel, etnaviv, dri-devel, platform-driver-x86

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

On Wed, Apr 19, 2017 at 08:11:16PM +0200, Arnd Bergmann wrote:
> 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>

Acked-by: Eduardo Valentin <edubezval@gmail.com>

> ---
>  drivers/acpi/Kconfig            | 2 +-
>  drivers/gpu/drm/etnaviv/Kconfig | 1 +
>  drivers/platform/x86/Kconfig    | 1 -
>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 03cc4e74096b..252399efa8b3 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -184,7 +184,7 @@ config ACPI_VIDEO
>  	tristate "Video"
>  	depends on X86 && BACKLIGHT_CLASS_DEVICE
>  	depends on INPUT
> -	select THERMAL
> +	depends on THERMAL
>  	help
>  	  This driver implements the ACPI Extensions For Display Adapters
>  	  for integrated graphics devices on motherboard, as specified in
> 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 e229ea317b9c..76ced87efde5 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -544,7 +544,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.
> -- 
> 2.9.0
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
  2017-04-19 18:11 ` Arnd Bergmann
                   ` (2 preceding siblings ...)
  (?)
@ 2017-04-24 10:44 ` Lucas Stach
  2017-04-24 17:39   ` Arnd Bergmann
  -1 siblings, 1 reply; 9+ messages in thread
From: Lucas Stach @ 2017-04-24 10:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: David Airlie, Zhang Rui, Eduardo Valentin, linux-pm,
	Sujith Thomas, Rafael J. Wysocki, Len Brown, Russell King,
	Christian Gmeiner, Darren Hart, Andy Shevchenko, Daniel Vetter,
	linux-acpi, linux-kernel, etnaviv, dri-devel, platform-driver-x86

Am Mittwoch, den 19.04.2017, 20:11 +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>

This patch mixes a few things, so the subject doesn't really fit. I'm
fine with taking the patch trough my tree, if I can get an ACK on the
ACPI part.

Regards,
Lucas

> ---
>  drivers/acpi/Kconfig            | 2 +-
>  drivers/gpu/drm/etnaviv/Kconfig | 1 +
>  drivers/platform/x86/Kconfig    | 1 -
>  3 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
> index 03cc4e74096b..252399efa8b3 100644
> --- a/drivers/acpi/Kconfig
> +++ b/drivers/acpi/Kconfig
> @@ -184,7 +184,7 @@ config ACPI_VIDEO
>  	tristate "Video"
>  	depends on X86 && BACKLIGHT_CLASS_DEVICE
>  	depends on INPUT
> -	select THERMAL
> +	depends on THERMAL
>  	help
>  	  This driver implements the ACPI Extensions For Display Adapters
>  	  for integrated graphics devices on motherboard, as specified in
> 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 e229ea317b9c..76ced87efde5 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -544,7 +544,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.

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
  2017-04-24 10:44 ` Lucas Stach
@ 2017-04-24 17:39   ` Arnd Bergmann
  2017-04-24 22:01     ` Eduardo Valentin
  0 siblings, 1 reply; 9+ messages in thread
From: Arnd Bergmann @ 2017-04-24 17:39 UTC (permalink / raw)
  To: Lucas Stach
  Cc: David Airlie, Zhang Rui, Eduardo Valentin, linux-pm,
	Sujith Thomas, Rafael J. Wysocki, Len Brown, Russell King,
	Christian Gmeiner, Darren Hart, Andy Shevchenko, Daniel Vetter,
	ACPI Devel Maling List, Linux Kernel Mailing List, etnaviv,
	dri-devel, platform-driver-x86

On Mon, Apr 24, 2017 at 12:44 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> Am Mittwoch, den 19.04.2017, 20:11 +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>
>
> This patch mixes a few things, so the subject doesn't really fit. I'm
> fine with taking the patch trough my tree, if I can get an ACK on the
> ACPI part.

Actually the ACPI part triggered a new warning that I haven't figured
out completely yet. Please disregard my patch for the moment.

I think we can just drop the dependency in ACPI_VIDEO, but I'm not
entirely sure yet if we could hit a broken configuration with THERMAL=m
and ACPI_VIDEO=y in that case. Unfortunately we cannot use the
same trick in ACPI_VIDEO that I used for ETNAVIV, because of
another circular dependency in ACPI.

        Arnd

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

* Re: [PATCH] drm/etnaviv: add thermal dependency
  2017-04-24 17:39   ` Arnd Bergmann
@ 2017-04-24 22:01     ` Eduardo Valentin
  0 siblings, 0 replies; 9+ messages in thread
From: Eduardo Valentin @ 2017-04-24 22:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Lucas Stach, David Airlie, Zhang Rui, linux-pm, Sujith Thomas,
	Rafael J. Wysocki, Len Brown, Russell King, Christian Gmeiner,
	Darren Hart, Andy Shevchenko, Daniel Vetter,
	ACPI Devel Maling List, Linux Kernel Mailing List, etnaviv,
	dri-devel, platform-driver-x86

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

dg
On Mon, Apr 24, 2017 at 07:39:27PM +0200, Arnd Bergmann wrote:
> On Mon, Apr 24, 2017 at 12:44 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> > Am Mittwoch, den 19.04.2017, 20:11 +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>
> >
> > This patch mixes a few things, so the subject doesn't really fit. I'm
> > fine with taking the patch trough my tree, if I can get an ACK on the
> > ACPI part.
> 
> Actually the ACPI part triggered a new warning that I haven't figured
> out completely yet. Please disregard my patch for the moment.
> 
> I think we can just drop the dependency in ACPI_VIDEO, but I'm not
> entirely sure yet if we could hit a broken configuration with THERMAL=m
> and ACPI_VIDEO=y in that case. Unfortunately we cannot use the
> same trick in ACPI_VIDEO that I used for ETNAVIV, because of
> another circular dependency in ACPI.
> 
>         Arnd

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH] drm/etnaviv: add THERMAL dependency
@ 2017-10-16 10:44 Philipp Zabel
  0 siblings, 0 replies; 9+ messages in thread
From: Philipp Zabel @ 2017-10-16 10:44 UTC (permalink / raw)
  To: Lucas Stach; +Cc: kernel, etnaviv, dri-devel

The etnaviv driver causes a link failure if it is built-in but THERMAL
is built as a module:

drivers/gpu/drm/etnaviv/etnaviv_gpu.o: In function `etnaviv_gpu_bind':
etnaviv_gpu.c:(.text+0x4c4): undefined reference to `thermal_of_cooling_device_register'
etnaviv_gpu.c:(.text+0x600): undefined reference to `thermal_cooling_device_unregister'
drivers/gpu/drm/etnaviv/etnaviv_gpu.o: In function `etnaviv_gpu_unbind':
etnaviv_gpu.c:(.text+0x2aac): undefined reference to `thermal_cooling_device_unregister'

Add a Kconfig dependency on THERMAL to avoid this, but allow building
with THERMAL disabled altogether. In that case, IS_ENABLED checks in the
code will disable the cooling device registration.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/gpu/drm/etnaviv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig
index 38b477b5fbf9d..39e402e30262f 100644
--- a/drivers/gpu/drm/etnaviv/Kconfig
+++ b/drivers/gpu/drm/etnaviv/Kconfig
@@ -4,6 +4,7 @@ config DRM_ETNAVIV
 	depends on DRM
 	depends on ARCH_MXC || ARCH_DOVE || (ARM && COMPILE_TEST)
 	depends on MMU
+	depends on THERMAL || !THERMAL # if THERMAL=m, this can't be 'y'
 	select SHMEM
 	select SYNC_FILE
 	select TMPFS
-- 
2.11.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2017-10-16 10:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-19 18:11 [PATCH] drm/etnaviv: add thermal dependency Arnd Bergmann
2017-04-19 18:11 ` Arnd Bergmann
2017-04-19 18:58 ` Andy Shevchenko
2017-04-19 18:58   ` Andy Shevchenko
2017-04-23 15:36 ` Eduardo Valentin
2017-04-24 10:44 ` Lucas Stach
2017-04-24 17:39   ` Arnd Bergmann
2017-04-24 22:01     ` Eduardo Valentin
  -- strict thread matches above, loose matches on Subject: below --
2017-10-16 10:44 [PATCH] drm/etnaviv: add THERMAL dependency Philipp Zabel

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.