Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
3995904d
Commit
3995904d
authored
Jun 21, 2024
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back thermal control material for v6.11.
parents
096597cf
b6846826
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
3 deletions
+35
-3
drivers/acpi/thermal.c
drivers/acpi/thermal.c
+7
-1
drivers/thermal/gov_step_wise.c
drivers/thermal/gov_step_wise.c
+17
-0
drivers/thermal/thermal_core.c
drivers/thermal/thermal_core.c
+11
-2
No files found.
drivers/acpi/thermal.c
View file @
3995904d
...
...
@@ -168,11 +168,17 @@ static int acpi_thermal_get_polling_frequency(struct acpi_thermal *tz)
static
int
acpi_thermal_temp
(
struct
acpi_thermal
*
tz
,
int
temp_deci_k
)
{
int
temp
;
if
(
temp_deci_k
==
THERMAL_TEMP_INVALID
)
return
THERMAL_TEMP_INVALID
;
return
deci_kelvin_to_millicelsius_with_offset
(
temp_deci_k
,
temp
=
deci_kelvin_to_millicelsius_with_offset
(
temp_deci_k
,
tz
->
kelvin_offset
);
if
(
temp
<=
0
)
return
THERMAL_TEMP_INVALID
;
return
temp
;
}
static
bool
acpi_thermal_trip_valid
(
struct
acpi_thermal_trip
*
acpi_trip
)
...
...
drivers/thermal/gov_step_wise.c
View file @
3995904d
...
...
@@ -93,6 +93,23 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
if
(
instance
->
initialized
&&
old_target
==
instance
->
target
)
continue
;
if
(
trip
->
type
==
THERMAL_TRIP_PASSIVE
)
{
/*
* If the target state for this thermal instance
* changes from THERMAL_NO_TARGET to something else,
* ensure that the zone temperature will be updated
* (assuming enabled passive cooling) until it becomes
* THERMAL_NO_TARGET again, or the cooling device may
* not be reset to its initial state.
*/
if
(
old_target
==
THERMAL_NO_TARGET
&&
instance
->
target
!=
THERMAL_NO_TARGET
)
tz
->
passive
++
;
else
if
(
old_target
!=
THERMAL_NO_TARGET
&&
instance
->
target
==
THERMAL_NO_TARGET
)
tz
->
passive
--
;
}
instance
->
initialized
=
true
;
mutex_lock
(
&
instance
->
cdev
->
lock
);
...
...
drivers/thermal/thermal_core.c
View file @
3995904d
...
...
@@ -999,9 +999,17 @@ __thermal_cooling_device_register(struct device_node *np,
if
(
ret
)
goto
out_cdev_type
;
/*
* The cooling device's current state is only needed for debug
* initialization below, so a failure to get it does not cause
* the entire cooling device initialization to fail. However,
* the debug will not work for the device if its initial state
* cannot be determined and drivers are responsible for ensuring
* that this will not happen.
*/
ret
=
cdev
->
ops
->
get_cur_state
(
cdev
,
&
current_state
);
if
(
ret
)
goto
out_cdev_type
;
current_state
=
ULONG_MAX
;
thermal_cooling_device_setup_sysfs
(
cdev
);
...
...
@@ -1016,7 +1024,8 @@ __thermal_cooling_device_register(struct device_node *np,
return
ERR_PTR
(
ret
);
}
thermal_debug_cdev_add
(
cdev
,
current_state
);
if
(
current_state
<=
cdev
->
max_state
)
thermal_debug_cdev_add
(
cdev
,
current_state
);
/* Add 'this' new cdev to the global cdev list */
mutex_lock
(
&
thermal_list_lock
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment