blob: bb3226af33b2162180ebf5d52bac0bde3bf65bb3 [file] [log] [blame]
Ben_Paifba51212019-08-05 18:34:34 +08001# Mihawk thermal policy for PDM.
Brad Bishopa450b862017-06-28 14:23:12 -04002#
Matthew Barthee6efcc2019-06-12 12:31:30 -05003# Shut down the system if more than three cores
Ben Paif6cbd7c2019-11-15 17:15:31 +08004# have a temperature greater than 95 degrees Celcius.
5# or ambient temperature greater than 45 degrees Celcius.
Brad Bishopa450b862017-06-28 14:23:12 -04006
7- name: core sensors
8 description: >
Matthew Barthee6efcc2019-06-12 12:31:30 -05009 'The machine has two processor chips with 24 cores each.'
Brad Bishopa450b862017-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 Paif6cbd7c2019-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
Brad Bishopa450b862017-06-28 14:23:12 -0400119- name: core temp
120 description: >
121 'Monitor the temperature of each core.'
122 class: group
123 group: property
124 type: int64
125 members:
126 - interface: xyz.openbmc_project.Sensor.Value
127 meta: TEMP
128 property: Value
129
Ben Paif6cbd7c2019-11-15 17:15:31 +0800130- name: ambient temp
131 description: >
132 'Monitor the ambient temperature.'
133 class: group
134 group: property
135 type: int64
136 members:
137 - interface: xyz.openbmc_project.Sensor.Value
138 meta: TEMP
139 property: Value
140
Brad Bishopa450b862017-06-28 14:23:12 -0400141- name: watch core temps
142 description: >
143 'Trigger logic on core temp changes.'
144 class: watch
145 watch: property
146 paths: core sensors
147 properties: core temp
148 callback: check temps
149
Ben Paif6cbd7c2019-11-15 17:15:31 +0800150- name: watch ambient temp
151 description: >
152 'Trigger logic on ambient temp changes.'
153 class: watch
154 watch: property
155 paths: ambient sensor
156 properties: ambient temp
157 callback: check ambient temp
158
Brad Bishopa450b862017-06-28 14:23:12 -0400159- name: check temps
160 description: >
161 'If this condition passes at least three cores are running
162 too hot. Shut the system down.'
163 class: condition
164 condition: count
165 paths: core sensors
166 properties: core temp
167 callback: log and shutdown
168 countop: '>='
169 countbound: 3
170 op: '>='
Ben Paif6cbd7c2019-11-15 17:15:31 +0800171 bound: 95000
172 oneshot: true
173
174- name: check ambient temp
175 description: >
176 'If the ambient sensor is too hot. Shut the system down.'
177 class: condition
178 condition: count
179 paths: ambient sensor
180 properties: ambient temp
181 callback: ambient log and shutdown
182 countop: '>='
183 countbound: 1
184 op: '>='
185 bound: 45000
Matt Spinlere495cb52018-02-19 15:46:39 -0600186 oneshot: true
Brad Bishopa450b862017-06-28 14:23:12 -0400187
188- name: log and shutdown
189 description: >
190 'Shut the system down and log an event.'
191 class: callback
192 callback: group
193 members:
194 - shutdown
Gunnar Millsd35ec0e2017-08-09 13:22:02 -0500195 - create criticalhigh error
Gunnar Mills001b8fa2017-09-12 14:30:06 -0500196 - create shutdown error
Brad Bishopa450b862017-06-28 14:23:12 -0400197
Ben Paif6cbd7c2019-11-15 17:15:31 +0800198- name: ambient log and shutdown
199 description: >
200 'Shut the system down and log an event.'
201 class: callback
202 callback: group
203 members:
204 - shutdown
205 - create ambient criticalhigh error
206 - create ambient shutdown error
207
Brad Bishopa450b862017-06-28 14:23:12 -0400208- name: shutdown
209 description: >
210 'Shut down the system.'
211 class: callback
212 callback: method
213 service: org.freedesktop.systemd1
214 path: /org/freedesktop/systemd1
215 interface: org.freedesktop.systemd1.Manager
216 method: StartUnit
217 args:
Matthew Barth21875f72017-10-17 09:53:47 -0500218 - value: obmc-chassis-hard-poweroff@0.target
Brad Bishopa450b862017-06-28 14:23:12 -0400219 type: string
220 - value: replace
221 type: string
222
Gunnar Millsd35ec0e2017-08-09 13:22:02 -0500223- name: create criticalhigh error
224 description: >
225 'Create a CriticalHigh Error log.'
226 class: callback
Matt Spinlere495cb52018-02-19 15:46:39 -0600227 callback: elog_with_metadata
Gunnar Millsd35ec0e2017-08-09 13:22:02 -0500228 paths: core sensors
229 properties: core temp
230 error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
Matt Spinlere495cb52018-02-19 15:46:39 -0600231 metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
Gunnar Mills001b8fa2017-09-12 14:30:06 -0500232
Ben Paif6cbd7c2019-11-15 17:15:31 +0800233- name: create ambient criticalhigh error
234 description: >
235 'Create a Ambient CriticalHigh Error log.'
236 class: callback
237 callback: elog_with_metadata
238 paths: ambient sensor
239 properties: ambient temp
240 error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh
241 metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA
242
Gunnar Mills001b8fa2017-09-12 14:30:06 -0500243- name: create shutdown error
244 description: >
245 'Create a SystemShutdown Error log.'
246 class: callback
247 callback: elog
248 paths: core sensors
249 properties: core temp
250 error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Processor
Ben Paif6cbd7c2019-11-15 17:15:31 +0800251
252- name: create ambient shutdown error
253 description: >
254 'Create a SystemShutdown Error log.'
255 class: callback
256 callback: elog
257 paths: ambient sensor
258 properties: ambient temp
259 error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Ambient