Skip to content

Commit df3b9ab

Browse files
authored
Merge pull request #458 from intel/v2.5.8_rc2_br
V2.5.8 rc2 br
2 parents 13c310e + fcb220d commit df3b9ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+384
-933
lines changed

Makefile.am

-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ thermald_SOURCES = \
7070
src/thd_cdev_rapl_dram.cpp \
7171
src/thd_cdev_backlight.cpp \
7272
src/thd_int3400.cpp \
73-
src/thd_cdev_kbl_amdgpu.cpp \
74-
src/thd_sensor_kbl_amdgpu_power.cpp \
75-
src/thd_sensor_kbl_amdgpu_thermal.cpp \
76-
src/thd_zone_kbl_g_mcp.cpp \
77-
src/thd_sensor_kbl_g_mcp.cpp \
78-
src/thd_zone_kbl_amdgpu.cpp \
7973
src/thd_sensor_rapl_power.cpp \
8074
src/thd_zone_rapl_power.cpp \
8175
src/thd_gddv.cpp \

README.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ Releases
111111

112112
Release 2.5.8
113113
- Lunar Lake support
114-
- Deprecate modem support
114+
- Arrow Lake support
115+
- Remove coverity errors to minimum
116+
- Add a script to plot temperature and trips from debug log
117+
- Deprecate modem/KBL-G support
115118
- Remove dbus-glib-devel as requirment
116119

117120
Release 2.5.7

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
AC_PREREQ(1.0)
22

33
m4_define([td_major_version], [2])
4-
m4_define([td_minor_version], [5.8-rc1])
4+
m4_define([td_minor_version], [5.8])
55
m4_define([td_version],
66
[td_major_version.td_minor_version])
77

src/main.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,10 @@ int main(int argc, char *argv[]) {
289289
fprintf(stderr, "Cannot create '%s': %s", TDRUNDIR, strerror(errno));
290290
exit(EXIT_FAILURE);
291291
}
292-
g_mkdir_with_parents(TDCONFDIR, 0755); // Don't care return value as directory
292+
if (g_mkdir_with_parents(TDCONFDIR, 0755) != 0) {
293+
// Don't care return value as directory
294+
fprintf(stderr, "Cannot create '%s': %s", TDCONFDIR, strerror(errno));
295+
}
293296
// may already exist
294297
if (log_info) {
295298
thd_log_level |= G_LOG_LEVEL_INFO;

src/thd_cdev.cpp

+20-9
Original file line numberDiff line numberDiff line change
@@ -254,17 +254,19 @@ int cthd_cdev::thd_cdev_set_state(int set_point, int target_temp,
254254
bool found = false;
255255
bool first_entry = false;
256256

257-
if (zone_trip_limits.size() == 0)
257+
if (zone_trip_limits.size() == 0) {
258258
first_entry = true;
259-
260-
// Search for the zone and trip id in the list
261-
for (unsigned int i = 0; i < zone_trip_limits.size(); ++i) {
262-
if (zone_trip_limits[i].zone == zone_id
263-
&& zone_trip_limits[i].trip == trip_id) {
264-
found = true;
265-
break;
259+
} else {
260+
// Search for the zone and trip id in the list
261+
for (unsigned int i = 0; i < zone_trip_limits.size(); ++i) {
262+
if (zone_trip_limits[i].zone == zone_id
263+
&& zone_trip_limits[i].trip == trip_id) {
264+
found = true;
265+
break;
266+
}
266267
}
267268
}
269+
268270
// If not found in the list add to the list
269271
if (!found) {
270272
zone_trip_limits_t limit;
@@ -326,7 +328,16 @@ int cthd_cdev::thd_cdev_set_state(int set_point, int target_temp,
326328

327329
zone_trip_limits_t limit;
328330

329-
limit = zone_trip_limits[zone_trip_limits.size() - 1];
331+
/* The below check to keep static analysis happy. There is no way
332+
* zone_trip_limits.size() == 0.
333+
* The above !found case ensures atleast size == 1
334+
*/
335+
unsigned int zone_trips_size = zone_trip_limits.size();
336+
337+
if (!zone_trips_size)
338+
zone_trips_size = 1;
339+
340+
limit = zone_trip_limits[zone_trips_size - 1];
330341
target_state_valid = limit.target_state_valid;
331342

332343
target_value = limit.target_value;

src/thd_cdev.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class cthd_cdev {
186186
virtual int map_target_state(int target_valid, int target_state) {
187187
return target_state;
188188
}
189-
virtual void set_adaptive_target(struct adaptive_target) {};
189+
virtual void set_adaptive_target(struct adaptive_target &target) {};
190190
void set_debounce_interval(int interval) {
191191
debounce_interval = interval;
192192
}
@@ -240,10 +240,10 @@ class cthd_cdev {
240240
return cdev_sysfs.get_base_path();
241241
}
242242
void set_cdev_type(std::string _type_str) {
243-
type_str = _type_str;
243+
type_str = std::move(_type_str);
244244
}
245245
void set_cdev_alias(std::string _alias_str) {
246-
alias_str = _alias_str;
246+
alias_str = std::move(_alias_str);
247247
}
248248
void set_pid_param(double kp, double ki, double kd) {
249249
pid_ctrl.kp = kp;
@@ -257,7 +257,7 @@ class cthd_cdev {
257257
}
258258

259259
void thd_cdev_set_write_prefix(std::string prefix) {
260-
write_prefix = prefix;
260+
write_prefix = std::move(prefix);
261261
}
262262

263263
void cdev_dump() {

src/thd_cdev_gen_sysfs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class cthd_gen_sysfs_cdev: public cthd_cdev {
3131

3232
public:
3333
cthd_gen_sysfs_cdev(unsigned int _index, std::string control_path) :
34-
cthd_cdev(_index, control_path) {
34+
cthd_cdev(_index, std::move(control_path)) {
3535
}
3636
virtual void set_curr_state(int state, int arg);
3737
virtual void set_curr_state_raw(int state, int arg);

src/thd_cdev_kbl_amdgpu.cpp

-144
This file was deleted.

src/thd_cdev_kbl_amdgpu.h

-44
This file was deleted.

src/thd_cdev_rapl.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,11 @@ void cthd_sysfs_cdev_rapl::set_tcc(int tcc) {
324324
if (!sysfs.exists("tcc_offset_degree_celsius"))
325325
return;
326326

327-
sysfs.write("tcc_offset_degree_celsius", tcc);
327+
if (sysfs.write("tcc_offset_degree_celsius", tcc) == -1)
328+
thd_log_debug("TCC write failed\n");
328329
}
329330

330-
void cthd_sysfs_cdev_rapl::set_adaptive_target(struct adaptive_target target) {
331+
void cthd_sysfs_cdev_rapl::set_adaptive_target(struct adaptive_target &target) {
331332
int argument = std::stoi(target.argument, NULL);
332333
if (target.code == "PL1MAX") {
333334
int pl1_rapl;

src/thd_cdev_rapl.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,16 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
8686
false), power_on_constraint_0_pwr(0), power_on_constraint_0_time_window(
8787
0), power_on_enable_status(0), device_name("TCPU.D0")
8888
{
89+
pl1_max_pwr = 0;
90+
pl1_min_pwr = 0;
91+
pl1_min_window = 0;
92+
pl1_max_window = 0;
93+
pl1_step_pwr = 0;
94+
pl1_valid = 0;
8995
}
9096
cthd_sysfs_cdev_rapl(unsigned int _index, int package,
9197
std::string contol_path) :
92-
cthd_cdev(_index, contol_path), phy_max(0), package_id(
98+
cthd_cdev(_index, std::move(contol_path)), phy_max(0), package_id(
9399
package), constraint_index(
94100
0), pl2_index(
95101
-1), dynamic_phy_max_enable(false), pl0_max_pwr(
@@ -99,6 +105,12 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
99105
false), power_on_constraint_0_pwr(0), power_on_constraint_0_time_window(
100106
0), power_on_enable_status(0), device_name("TCPU.D0")
101107
{
108+
pl1_max_pwr = 0;
109+
pl1_min_pwr = 0;
110+
pl1_min_window = 0;
111+
pl1_max_window = 0;
112+
pl1_step_pwr = 0;
113+
pl1_valid = 0;
102114
}
103115

104116
virtual void set_curr_state(int state, int arg);
@@ -108,7 +120,7 @@ class cthd_sysfs_cdev_rapl: public cthd_cdev {
108120
virtual int update();
109121
virtual void set_curr_state_raw(int state, int arg);
110122
void set_tcc(int tcc);
111-
void set_adaptive_target(struct adaptive_target target);
123+
void set_adaptive_target(struct adaptive_target &target);
112124
void thd_cdev_set_min_state_param(int arg);
113125
int get_phy_max_state() {
114126
return phy_max;

src/thd_cdev_rapl_dram.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int cthd_sysfs_cdev_rapl_dram::update() {
6262
if (!found)
6363
return THD_ERROR;
6464

65-
cdev_sysfs.update_path(path_name);
65+
cdev_sysfs.update_path(std::move(path_name));
6666

6767
return cthd_sysfs_cdev_rapl::update();
6868
}

src/thd_cdev_therm_sys_fs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class cthd_sysfs_cdev: public cthd_cdev {
3232

3333
public:
3434
cthd_sysfs_cdev(unsigned int _index, std::string control_path) :
35-
cthd_cdev(_index, control_path) {
35+
cthd_cdev(_index, std::move(control_path)) {
3636
}
3737
virtual void set_curr_state(int state, int arg);
3838
virtual int get_curr_state();

0 commit comments

Comments
 (0)