Skip to content

Commit 66bd366

Browse files
committed
add flag to control shutdown cpu and check dimm thermal
[Root Cause] NA [Solution] NA [Affected Functions] NA [Verification] OK.
1 parent 09bd90e commit 66bd366

File tree

1 file changed

+21
-0
lines changed
  • common/recipes-core/fan-ctrl/fan-ctrl

1 file changed

+21
-0
lines changed

common/recipes-core/fan-ctrl/fan-ctrl/fand.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878

7979
#include "watchdog.h"
8080

81+
#define USERVER_ERROR_THRESHOLD INTERNAL_TEMPS(120)
82+
8183
#if !defined(CONFIG_LIGHTNING)
8284
/* Sensor definitions */
8385

@@ -768,6 +770,21 @@ int read_temp(const char *device, int *value) {
768770
usleep(10000);
769771
}
770772

773+
if (strstr(device, USERVER_TEMP_DEVICE)) {
774+
retry = 0;
775+
if (*value > USERVER_ERROR_THRESHOLD) {
776+
while(retry++ <= 3) {
777+
*value = 0;
778+
rc = read_device(full_name, value);
779+
usleep(10000);
780+
}
781+
if (*value > USERVER_ERROR_THRESHOLD) {
782+
syslog(LOG_CRIT, "Userver(COMe) temperature read error, value:%d. \n", (*value)/1000);
783+
*value = BAD_TEMP;
784+
}
785+
}
786+
}
787+
771788
return rc;
772789
}
773790
#endif
@@ -1505,6 +1522,10 @@ int write_fan_led(const int fan, const char *color) {
15051522
}
15061523

15071524
int server_shutdown(const char *why) {
1525+
if(0 == access("/mnt/data/etc/not_shutdown_come", F_OK))
1526+
{
1527+
return 0;
1528+
}
15081529
int fan;
15091530
for (fan = 0; fan < total_fans; fan++) {
15101531
write_fan_speed(fan + fan_offset, fan_max);

0 commit comments

Comments
 (0)