diff options
author | Richard Yeh <rcy@google.com> | 2022-11-28 04:08:24 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-12-17 05:22:03 +0000 |
commit | 5e2e4a52a1b2d5231285a7ff5081f291b8adad1a (patch) | |
tree | 00ee5d38eb097df437472d6be0b016ce7ac25fa6 /board/moonbuggy/board.c | |
parent | 62a569cef145821672783e2eebbab506f9980a73 (diff) | |
download | chrome-ec-5e2e4a52a1b2d5231285a7ff5081f291b8adad1a.tar.gz |
{ambassador,genesis,moonbuggy,scout}: Increase fan to reduce throttling.
Chromebox for Meetings (CfM) devices are videoconferencing appliances.
Discovering that a significant fraction of our fleet was throttling the
CPU due to temperature, resulting in bad video quality, we have decided
that these devices should never throttle. The present change reduces the
temperature thresholds at which we increase fan speeds. For most of the
time, when the CfM is idle, we expect no or little change in fan speeds.
During calls, the CfM CPU can exceed 60 C, and the sensors controlling
the fan are typically 10-20 degrees C cooler than the CPU, so we set
the maximum-fan temperature to 50-55 C in an attempt to arrest any
temperature increase before the CPU reaches throttling temperatures.
We add fan tables to enable hysteresis in the fan speed setting. Fan
RPMs are chosen to span the min-to-max range, while avoiding 50 Hz and
60 Hz line frequencies.
fizz and kalista boards are shared with non-CfM versions, while the
other boards are CfM-only. Since those boards are several years old, we
plan to build these firmware changes only into CfM-branch releases, not
all fizz and kalista devices.
Additional details at go/cfm-overheating . Temperature traces with load
testing on both top-of-tree and firmware with this change are shown at
go/cfm-overheating#heading=h.ykpzxotgnu2j
BRANCH=update-fan-tables
BUG=b:252966838,b:191187610,chromium:1383859
TEST=Confirmed validity of settings with `ectool thermalset`. Built
firmware, flashed to endeavour and excelsior (fizz), verified that fan
turns on earlier. This does not completely prevent throttling from
47.25 W to 15.00 W on Kaby Lake boards (endeavour, fizz, kalista), but
it does prevent dropping below 15.00 W. Comet Lake boards (ambassador,
genesis, moonbuggy, scout) start at 15.00 W and rarely throttle anyway.
Signed-off-by: Richard Yeh <rcy@google.com>
Change-Id: I7f23583ca1b85d3b8b9da43918880f68b41538c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4060610
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'board/moonbuggy/board.c')
-rw-r--r-- | board/moonbuggy/board.c | 71 |
1 files changed, 50 insertions, 21 deletions
diff --git a/board/moonbuggy/board.c b/board/moonbuggy/board.c index 198c16851c..9ee309d2fe 100644 --- a/board/moonbuggy/board.c +++ b/board/moonbuggy/board.c @@ -281,31 +281,60 @@ BUILD_ASSERT(ARRAY_SIZE(mft_channels) == MFT_CH_COUNT); /******************************************************************************/ /* Thermal control; drive fan based on temperature sensors. */ -/* - * TODO(b/202062363): Remove when clang is fixed. - */ -#define THERMAL_A \ - { \ - .temp_host = { \ - [EC_TEMP_THRESH_WARN] = 0, \ - [EC_TEMP_THRESH_HIGH] = C_TO_K(85), \ - [EC_TEMP_THRESH_HALT] = C_TO_K(90), \ - }, \ - .temp_host_release = { \ - [EC_TEMP_THRESH_WARN] = 0, \ - [EC_TEMP_THRESH_HIGH] = C_TO_K(78), \ - [EC_TEMP_THRESH_HALT] = 0, \ - }, \ - .temp_fan_off = C_TO_K(25), \ - .temp_fan_max = C_TO_K(89), \ - } -__maybe_unused static const struct ec_thermal_config thermal_a = THERMAL_A; - +static const int temp_fan_off = C_TO_K(35); +static const int temp_fan_max = C_TO_K(55); struct ec_thermal_config thermal_params[] = { - [TEMP_SENSOR_CORE] = THERMAL_A, + [TEMP_SENSOR_CORE] = { + .temp_host = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(85), + [EC_TEMP_THRESH_HALT] = C_TO_K(90), + }, + .temp_host_release = { + [EC_TEMP_THRESH_WARN] = 0, + [EC_TEMP_THRESH_HIGH] = C_TO_K(78), + [EC_TEMP_THRESH_HALT] = 0, + }, + .temp_fan_off = temp_fan_off, + .temp_fan_max = temp_fan_max, + }, }; + BUILD_ASSERT(ARRAY_SIZE(thermal_params) == TEMP_SENSOR_COUNT); +static const struct fan_step_1_1 fan_table0[] = { + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(35), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(41), + .rpm = 2500 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(40), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(44), + .rpm = 2900 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(42), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(46), + .rpm = 3400 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(44), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(48), + .rpm = 3900 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(46), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(50), + .rpm = 4400 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(48), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(52), + .rpm = 4900 }, + { .decreasing_temp_ratio_threshold = TEMP_TO_RATIO(50), + .increasing_temp_ratio_threshold = TEMP_TO_RATIO(55), + .rpm = 5300 }, +}; +#define NUM_FAN_LEVELS ARRAY_SIZE(fan_table0) + +static const struct fan_step_1_1 *fan_table = fan_table0; + +int fan_percent_to_rpm(int fan, int temp_ratio) +{ + return temp_ratio_to_rpm_hysteresis(fan_table, NUM_FAN_LEVELS, fan, + temp_ratio, NULL); +} + /* Power sensors */ const struct ina3221_t ina3221[] = { { I2C_PORT_INA, 0x40, { "PP3300_G", "PP5000_A", "PP3300_WLAN" } }, |