blob: 727630cb80a2dd79a7b612a4b35a54fa7d7350a3 [file] [log] [blame]
Ben_Pai949f9142019-08-05 18:34:34 +08001# Mihawk thermal policy for PDM.
Brad Bishop157ac412017-06-28 14:23:12 -04002#
Matthew Barthfd06a2c2019-06-12 12:31:30 -05003# Shut down the system if more than three cores
Ben Pai7f94a4b2019-11-15 17:15:31 +08004# have a temperature greater than 95 degrees Celcius.
5# or ambient temperature greater than 45 degrees Celcius.
Brad Bishop157ac412017-06-28 14:23:12 -04006
7- name: core sensors
8 description: >
Matthew Barthfd06a2c2019-06-12 12:31:30 -05009 'The machine has two processor chips with 24 cores each.'
Brad Bishop157ac412017-06-28 14:23:12 -040010 class: group
11 group: path
12 members:
13 - meta: SENSOR
14 path: /xyz/openbmc_project/sensors/temperature/p0_core0_temp
15 - meta: SENSOR
16 path: /xyz/openbmc_project/sensors/temperature/p0_core1_temp
17 - meta: SENSOR
18 path: /xyz/openbmc_project/sensors/temperature/p0_core2_temp
19 - meta: SENSOR
20 path: /xyz/openbmc_project/sensors/temperature/p0_core3_temp
21 - meta: SENSOR
22 path: /xyz/openbmc_project/sensors/temperature/p0_core4_temp
23 - meta: SENSOR
24 path: /xyz/openbmc_project/sensors/temperature/p0_core5_temp
25 - meta: SENSOR
26 path: /xyz/openbmc_project/sensors/temperature/p0_core6_temp
27 - meta: SENSOR
28 path: /xyz/openbmc_project/sensors/temperature/p0_core7_temp
29 - meta: SENSOR
30 path: /xyz/openbmc_project/sensors/temperature/p0_core8_temp
31 - meta: SENSOR
32 path: /xyz/openbmc_project/sensors/temperature/p0_core9_temp
33 - meta: SENSOR
34 path: /xyz/openbmc_project/sensors/temperature/p0_core10_temp
35 - meta: SENSOR
36 path: /xyz/openbmc_project/sensors/temperature/p0_core11_temp
37 - meta: SENSOR
38 path: /xyz/openbmc_project/sensors/temperature/p0_core12_temp
39 - meta: SENSOR
40 path: /xyz/openbmc_project/sensors/temperature/p0_core13_temp
41 - meta: SENSOR
42 path: /xyz/openbmc_project/sensors/temperature/p0_core14_temp
43 - meta: SENSOR
44 path: /xyz/openbmc_project/sensors/temperature/p0_core15_temp
45 - meta: SENSOR
46 path: /xyz/openbmc_project/sensors/temperature/p0_core16_temp
47 - meta: SENSOR
48 path: /xyz/openbmc_project/sensors/temperature/p0_core17_temp
49 - meta: SENSOR
50 path: /xyz/openbmc_project/sensors/temperature/p0_core18_temp
51 - meta: SENSOR
52 path: /xyz/openbmc_project/sensors/temperature/p0_core19_temp
53 - meta: SENSOR
54 path: /xyz/openbmc_project/sensors/temperature/p0_core20_temp
55 - meta: SENSOR
56 path: /xyz/openbmc_project/sensors/temperature/p0_core21_temp
57 - meta: SENSOR
58 path: /xyz/openbmc_project/sensors/temperature/p0_core22_temp
59 - meta: SENSOR
60 path: /xyz/openbmc_project/sensors/temperature/p0_core23_temp
61 - meta: SENSOR
62 path: /xyz/openbmc_project/sensors/temperature/p1_core0_temp
63 - meta: SENSOR
64 path: /xyz/openbmc_project/sensors/temperature/p1_core1_temp
65 - meta: SENSOR
66 path: /xyz/openbmc_project/sensors/temperature/p1_core2_temp
67 - meta: SENSOR
68 path: /xyz/openbmc_project/sensors/temperature/p1_core3_temp
69 - meta: SENSOR
70 path: /xyz/openbmc_project/sensors/temperature/p1_core4_temp
71 - meta: SENSOR
72 path: /xyz/openbmc_project/sensors/temperature/p1_core5_temp
73 - meta: SENSOR
74 path: /xyz/openbmc_project/sensors/temperature/p1_core6_temp
75 - meta: SENSOR
76 path: /xyz/openbmc_project/sensors/temperature/p1_core7_temp
77 - meta: SENSOR
78 path: /xyz/openbmc_project/sensors/temperature/p1_core8_temp
79 - meta: SENSOR
80 path: /xyz/openbmc_project/sensors/temperature/p1_core9_temp
81 - meta: SENSOR
82 path: /xyz/openbmc_project/sensors/temperature/p1_core10_temp
83 - meta: SENSOR
84 path: /xyz/openbmc_project/sensors/temperature/p1_core11_temp
85 - meta: SENSOR
86 path: /xyz/openbmc_project/sensors/temperature/p1_core12_temp
87 - meta: SENSOR
88 path: /xyz/openbmc_project/sensors/temperature/p1_core13_temp
89 - meta: SENSOR
90 path: /xyz/openbmc_project/sensors/temperature/p1_core14_temp
91 - meta: SENSOR
92 path: /xyz/openbmc_project/sensors/temperature/p1_core15_temp
93 - meta: SENSOR
94 path: /xyz/openbmc_project/sensors/temperature/p1_core16_temp
95 - meta: SENSOR
96 path: /xyz/openbmc_project/sensors/temperature/p1_core17_temp
97 - meta: SENSOR
98 path: /xyz/openbmc_project/sensors/temperature/p1_core18_temp
99 - meta: SENSOR
100 path: /xyz/openbmc_project/sensors/temperature/p1_core19_temp
101 - meta: SENSOR
102 path: /xyz/openbmc_project/sensors/temperature/p1_core20_temp
103 - meta: SENSOR
104 path: /xyz/openbmc_project/sensors/temperature/p1_core21_temp
105 - meta: SENSOR
106 path: /xyz/openbmc_project/sensors/temperature/p1_core22_temp
107 - meta: SENSOR
108 path: /xyz/openbmc_project/sensors/temperature/p1_core23_temp
109
Ben Pai7f94a4b2019-11-15 17:15:31 +0800110- name: ambient sensor
111 description: >
112 'The machine has one ambient temperature sensors.'
113 class: group
114 group: path
115 members:
116 - meta: SENSOR
117 path: /xyz/openbmc_project/sensors/temperature/ambient_temp
118
Ben Pai623eb4d2019-11-25 16:54:29 +0800119- name: gpu sensors
120 description: >
121 'Each gpu has its own temperature sensor.'
122 class: group
123 group: path
124 members:
125 - meta: SENSOR
126 path: /xyz/openbmc_project/sensors/temperature/gpu0
127 - meta: SENSOR
128 path: /xyz/openbmc_project/sensors/temperature/gpu1
129 - meta: SENSOR
130 path: /xyz/openbmc_project/sensors/temperature/gpu2
131 - meta: SENSOR
132 path: /xyz/openbmc_project/sensors/temperature/gpu3
133 - meta: SENSOR
134 path: /xyz/openbmc_project/sensors/temperature/gpu4
135 - meta: SENSOR
136 path: /xyz/openbmc_project/sensors/temperature/gpu5
137 - meta: SENSOR
138 path: /xyz/openbmc_project/sensors/temperature/gpu6
139 - meta: SENSOR
140 path: /xyz/openbmc_project/sensors/temperature/gpu7
141
Brad Bishop157ac412017-06-28 14:23:12 -0400142- name: core temp
143 description: >
144 'Monitor the temperature of each core.'
145 class: group
146 group: property
147 type: int64
148 members:
149 - interface: xyz.openbmc_project.Sensor.Value
150 meta: TEMP
151 property: Value
152
Ben Pai7f94a4b2019-11-15 17:15:31 +0800153- name: ambient temp
154 description: >
155 'Monitor the ambient temperature.'
156 class: group
157 group: property
158 type: int64
159 members:
160 - interface: xyz.openbmc_project.Sensor.Value
161 meta: TEMP
162 property: Value
163
Ben Pai623eb4d2019-11-25 16:54:29 +0800164- name: gpu temp
165 description: >
166 'Monitor the temperature of each gpu core.'
167 class: group
168 group: property
169 type: int64
170 members:
171 - interface: xyz.openbmc_project.Sensor.Value
172 meta: TEMP
173 property: Value
174
Brad Bishop157ac412017-06-28 14:23:12 -0400175- name: watch core temps
176 description: >
177 'Trigger logic on core temp changes.'
178 class: watch
179 watch: property
180 paths: core sensors
181 properties: core temp
182 callback: check temps
183
Ben Pai7f94a4b2019-11-15 17:15:31 +0800184- name: watch ambient temp
185 description: >
186 'Trigger logic on ambient temp changes.'
187 class: watch
188 watch: property
189 paths: ambient sensor
190 properties: ambient temp
191 callback: check ambient temp
192
Ben Pai623eb4d2019-11-25 16:54:29 +0800193- name: watch gpu temps
194 description: >
195 'Trigger logic on gpu core temp changes.'
196 class: watch
197 watch: property
198 paths: gpu sensors
199 properties: gpu temp
200 callback: check gpu temps
201
Brad Bishop157ac412017-06-28 14:23:12 -0400202- name: check temps
203 description: >
204 'If this condition passes at least three cores are running
205 too hot. Shut the system down.'
206 class: condition
207 condition: count
208 paths: core sensors
209 properties: core temp
210 callback: log and shutdown
211 countop: '>='
212 countbound: 3
213 op: '>='
Ben Pai7f94a4b2019-11-15 17:15:31 +0800214 bound: 95000
215 oneshot: true
216
217- name: check ambient temp
218 description: >
219 'If the ambient sensor is too hot. Shut the system down.'
220 class: condition
221 condition: count
222 paths: ambient sensor
223 properties: ambient temp
224 callback: ambient log and shutdown
225 countop: '>='
226 countbound: 1
227 op: '>='
228 bound: 45000
Matt Spinler86c240c2018-02-19 15:46:39 -0600229 oneshot: true
Brad Bishop157ac412017-06-28 14:23:12 -0400230
Ben Pai623eb4d2019-11-25 16:54:29 +0800231- name: check gpu temps
232 description: >
233 'If the gpu temperature sensor is too hot. Shut the system down.'
234 class: condition
235 condition: count
236 paths: gpu sensors
237 properties: gpu temp
238 callback: gpu log and shutdown
239 countop: '>='
240 countbound: 1
241 op: '>='
242 bound: 92
243 oneshot: true
244
Brad Bishop157ac412017-06-28 14:23:12 -0400245- name: log and shutdown
246 description: >
247 'Shut the system down and log an event.'
248 class: callback
249 callback: group
250 members:
251 - shutdown
Gunnar Millsb3a42602017-08-09 13:22:02 -0500252 - create criticalhigh error
Gunnar Millsa934a902017-09-12 14:30:06 -0500253 - create shutdown error
Brad Bishop157ac412017-06-28 14:23:12 -0400254
Ben Pai7f94a4b2019-11-15 17:15:31 +0800255- name: ambient log and shutdown
256 description: >
257 'Shut the system down and log an event.'
258 class: callback
259 callback: group
260 members:
261 - shutdown
262 - create ambient criticalhigh error
263 - create ambient shutdown error
264
Ben Pai623eb4d2019-11-25 16:54:29 +0800265- name: gpu log and shutdown
266 description: >
267 'Shut the system down and log an event.'
268 class: callback
269 callback: group
270 members:
271 - shutdown
272 - create gpu criticalhigh error
273 - create gpu shutdown error
274
Brad Bishop157ac412017-06-28 14:23:12 -0400275- name: shutdown
276 description: >
277 'Shut down the system.'
278 class: callback
279 callback: method
280 service: org.freedesktop.systemd1
281 path: /org/freedesktop/systemd1
282 interface: org.freedesktop.systemd1.Manager
283 method: StartUnit
284 args:
Matthew Barthb1e38df2017-10-17 09:53:47 -0500285 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishop157ac412017-06-28 14:23:12 -0400286 type: string
287 - value: replace
288 type: string
289
Gunnar Millsb3a42602017-08-09 13:22:02 -0500290- name: create criticalhigh error
291 description: >
292 'Create a CriticalHigh Error log.'
293 class: callback
Matt Spinler86c240c2018-02-19 15:46:39 -0600294 callback: elog_with_metadata
Gunnar Millsb3a42602017-08-09 13:22:02 -0500295 paths: core sensors
296 properties: core temp
297 error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
Matt Spinler86c240c2018-02-19 15:46:39 -0600298 metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
Gunnar Millsa934a902017-09-12 14:30:06 -0500299
Ben Pai7f94a4b2019-11-15 17:15:31 +0800300- name: create ambient criticalhigh error
301 description: >
302 'Create a Ambient CriticalHigh Error log.'
303 class: callback
304 callback: elog_with_metadata
305 paths: ambient sensor
306 properties: ambient temp
307 error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
308 metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
309
Ben Pai623eb4d2019-11-25 16:54:29 +0800310- name: create gpu criticalhigh error
311 description: >
312 'Create a GPU CriticalHigh Error log.'
313 class: callback
314 callback: elog_with_metadata
315 paths: gpu sensors
316 properties: gpu temp
317 error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
318 metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
319
Gunnar Millsa934a902017-09-12 14:30:06 -0500320- name: create shutdown error
321 description: >
322 'Create a SystemShutdown Error log.'
323 class: callback
324 callback: elog
325 paths: core sensors
326 properties: core temp
327 error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Processor
Ben Pai7f94a4b2019-11-15 17:15:31 +0800328
329- name: create ambient shutdown error
330 description: >
331 'Create a SystemShutdown Error log.'
332 class: callback
333 callback: elog
334 paths: ambient sensor
335 properties: ambient temp
336 error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Ambient
Ben Pai623eb4d2019-11-25 16:54:29 +0800337
338- name: create gpu shutdown error
339 description: >
340 'Create a SystemShutdown Error log.'
341 class: callback
342 callback: elog
343 paths: gpu sensors
344 properties: gpu temp
345 error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::GPU