Brad Bishop | 157ac41 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 1 | # Witherspoon thermal policy for PDM. |
| 2 | # |
| 3 | # Shut down a Witherspoon system if more than three POWER9 cores |
| 4 | # have a temperature greater than 115 degrees Celcius. |
| 5 | |
| 6 | |
| 7 | - name: core sensors |
| 8 | description: > |
| 9 | 'Witherspoon has two POWER9 chips with 24 cores each.' |
| 10 | 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 | |
| 110 | - name: core temp |
| 111 | description: > |
| 112 | 'Monitor the temperature of each core.' |
| 113 | class: group |
| 114 | group: property |
| 115 | type: int64 |
| 116 | members: |
| 117 | - interface: xyz.openbmc_project.Sensor.Value |
| 118 | meta: TEMP |
| 119 | property: Value |
| 120 | |
| 121 | - name: watch core temps |
| 122 | description: > |
| 123 | 'Trigger logic on core temp changes.' |
| 124 | class: watch |
| 125 | watch: property |
| 126 | paths: core sensors |
| 127 | properties: core temp |
| 128 | callback: check temps |
| 129 | |
| 130 | - name: check temps |
| 131 | description: > |
| 132 | 'If this condition passes at least three cores are running |
| 133 | too hot. Shut the system down.' |
| 134 | class: condition |
| 135 | condition: count |
| 136 | paths: core sensors |
| 137 | properties: core temp |
| 138 | callback: log and shutdown |
| 139 | countop: '>=' |
| 140 | countbound: 3 |
| 141 | op: '>=' |
| 142 | bound: 115000 |
| 143 | |
| 144 | - name: log and shutdown |
| 145 | description: > |
| 146 | 'Shut the system down and log an event.' |
| 147 | class: callback |
| 148 | callback: group |
| 149 | members: |
| 150 | - shutdown |
| 151 | - log |
Gunnar Mills | b3a4260 | 2017-08-09 13:22:02 -0500 | [diff] [blame] | 152 | - create criticalhigh error |
Gunnar Mills | a934a90 | 2017-09-12 14:30:06 -0500 | [diff] [blame] | 153 | - create shutdown error |
Brad Bishop | 157ac41 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 154 | |
| 155 | - name: shutdown |
| 156 | description: > |
| 157 | 'Shut down the system.' |
| 158 | class: callback |
| 159 | callback: method |
| 160 | service: org.freedesktop.systemd1 |
| 161 | path: /org/freedesktop/systemd1 |
| 162 | interface: org.freedesktop.systemd1.Manager |
| 163 | method: StartUnit |
| 164 | args: |
| 165 | - value: obmc-host-shutdown@0.target |
| 166 | type: string |
| 167 | - value: replace |
| 168 | type: string |
| 169 | |
| 170 | - name: log |
| 171 | description: > |
| 172 | 'Log a shutdown event to the systemd journal.' |
| 173 | class: callback |
| 174 | callback: journal |
| 175 | paths: core sensors |
| 176 | properties: core temp |
| 177 | severity: ERR |
| 178 | message: The system is too hot. Shutting down. |
Gunnar Mills | b3a4260 | 2017-08-09 13:22:02 -0500 | [diff] [blame] | 179 | |
| 180 | - name: create criticalhigh error |
| 181 | description: > |
| 182 | 'Create a CriticalHigh Error log.' |
| 183 | class: callback |
| 184 | callback: elog |
| 185 | paths: core sensors |
| 186 | properties: core temp |
| 187 | error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh |
| 188 | metadata: |
| 189 | - name: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_TYPE |
| 190 | value: temperature |
| 191 | type: string |
Gunnar Mills | a934a90 | 2017-09-12 14:30:06 -0500 | [diff] [blame] | 192 | |
| 193 | - name: create shutdown error |
| 194 | description: > |
| 195 | 'Create a SystemShutdown Error log.' |
| 196 | class: callback |
| 197 | callback: elog |
| 198 | paths: core sensors |
| 199 | properties: core temp |
| 200 | error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Processor |