thermal: Share THERMAL_NO_LIMIT between kernel and DT bindings
Subsystems (2)
PATCH 1/1 thermal: Share THERMAL_NO_LIMIT between kernel and DT bindings
THERMAL_NO_LIMIT is defined separately in the thermal core and the DT bindings, using different expressions for the same no-limit sentinel.
Define it as 0xffffffff in the DT bindings header and include that header from linux/thermal.h. Remove the duplicate kernel definition so both interfaces use the same unsigned 32-bit value while preserving the existing DT encoding.
--- include/dt-bindings/thermal/thermal.h | 2 +- include/linux/thermal.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
include/dt-bindings/thermal/thermal.h +1 -1
@@ -10,7 +10,7 @@#define _DT_BINDINGS_THERMAL_THERMAL_H/* On cooling devices upper and lower limits */ -#define THERMAL_NO_LIMIT (~0) +#define THERMAL_NO_LIMIT 0xffffffff/* ~0U */ #endif
include/linux/thermal.h +2 -3
@@ -17,12 +17,11 @@#include <linux/workqueue.h> #include <uapi/linux/thermal.h> +#include <dt-bindings/thermal/thermal.h> +/* invalid cooling state */ #define THERMAL_CSTATE_INVALID -1UL -/* No upper/lower limit requirement */ -#define THERMAL_NO_LIMIT ((u32)~0) -/* Default weight of a bound cooling device */ #define THERMAL_WEIGHT_DEFAULT 0
Signature · 1 line
2.53.0
Rafael J. Wysocki (Intel)
maintainerQuoted 10 lines · Daniel Lezcano
THERMAL_NO_LIMITis defined separately in the thermal core and the DT bindings, using different expressions for the same no-limit sentinel.Define it as
0xffffffffin the DT bindings header and include that header fromlinux/thermal.h. Remove the duplicate kernel definition so both interfaces use the same unsigned 32-bit value while preserving the existing DT encoding.Signed-off-by Daniel Lezcano <[email protected]>
But THERMAL_NO_LIMIT is also used by the core on systems without DT, so why is defining it in DT bindings not confusing?
Quoted 40 lines
--- include/dt-bindings/thermal/thermal.h | 2 +- include/linux/thermal.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)include/dt-bindings/thermal/thermal.h +1
-1@@ -10,7 +10,7 @@#define _DT_BINDINGS_THERMAL_THERMAL_H/* On cooling devices upper and lower limits */ -#define THERMAL_NO_LIMIT (~0) +#define THERMAL_NO_LIMIT 0xffffffff/* ~0U */ #endif include/linux/thermal.h +2
-4@@ -17,12 +17,11 @@#include <linux/workqueue.h> #include <uapi/linux/thermal.h> +#include <dt-bindings/thermal/thermal.h> +/* invalid cooling state */ #define THERMAL_CSTATE_INVALID -1UL -/* No upper/lower limit requirement */ -#define THERMAL_NO_LIMIT ((u32)~0) -/* Default weight of a bound cooling device */ #define THERMAL_WEIGHT_DEFAULT 0 --2.53.0
Quoted 11 lines · Rafael J. Wysocki (Intel)
Quoted 9 lines · Daniel Lezcano
THERMAL_NO_LIMITis defined separately in the thermal core and the DT bindings, using different expressions for the same no-limit sentinel.Define it as
0xffffffffin the DT bindings header and include that header fromlinux/thermal.h. Remove the duplicate kernel definition so both interfaces use the same unsigned 32-bit value while preserving the existing DT encoding.
Quoted 4 lines
Quoted 1 line
Signed-off-by Daniel Lezcano <[email protected]>But
THERMAL_NO_LIMITis also used by the core on systems without DT, so why is defining it in DT bindings not confusing?
Yes, you are right. I missed ACPI relies on the THERMAL_NO_LIMIT default for the cooling spec
Rafael J. Wysocki (Intel)
maintainerQuoted 13 lines · Daniel Lezcano
Quoted 11 lines · Rafael J. Wysocki (Intel)
Quoted 9 lines · Daniel Lezcano
THERMAL_NO_LIMITis defined separately in the thermal core and the DT bindings, using different expressions for the same no-limit sentinel.Define it as
0xffffffffin the DT bindings header and include that header fromlinux/thermal.h. Remove the duplicate kernel definition so both interfaces use the same unsigned 32-bit value while preserving the existing DT encoding.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Daniel Lezcano <[email protected]>But
THERMAL_NO_LIMITis also used by the core on systems without DT, so why is defining it in DT bindings not confusing?Yes, you are right. I missed ACPI relies on the
THERMAL_NO_LIMITdefault for the cooling spec
Well, in principle not just ACPI, but anyone whose .should_bind() leaves the struct cooling_spec as is.
Quoted 19 lines · Daniel Lezcano
THERMAL_NO_LIMITis defined separately in the thermal core and the DT bindings, using different expressions for the same no-limit sentinel.Define it as
0xffffffffin the DT bindings header and include that header fromlinux/thermal.h. Remove the duplicate kernel definition so both interfaces use the same unsigned 32-bit value while preserving the existing DT encoding.Signed-off-by Daniel Lezcano <[email protected]>--- include/dt-bindings/thermal/thermal.h | 2 +- include/linux/thermal.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)include/dt-bindings/thermal/thermal.h +0
-0
include/dt-bindings/thermal/thermal.h line 13
Quoted 5 lines
include/dt-bindings/thermal/thermal.h +1
-1@@ -10,7 +10,7 @@#define _DT_BINDINGS_THERMAL_THERMAL_H/* On cooling devices upper and lower limits */ -#define THERMAL_NO_LIMIT (~0) +#define THERMAL_NO_LIMIT 0xffffffff/* ~0U */
This should be actually separate patch, as we expect usually of bindings.
Best regards,
Krzysztof