Matthew Barth | ee6efcc | 2019-06-12 12:31:30 -0500 | [diff] [blame] | 1 | # Machine thermal policy for PDM. |
Brad Bishop | a450b86 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 2 | # |
Matthew Barth | ee6efcc | 2019-06-12 12:31:30 -0500 | [diff] [blame] | 3 | # Shut down the system if more than three cores |
Brad Bishop | a450b86 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 4 | # have a temperature greater than 115 degrees Celcius. |
| 5 | |
| 6 | |
| 7 | - name: core sensors |
| 8 | description: > |
Matthew Barth | ee6efcc | 2019-06-12 12:31:30 -0500 | [diff] [blame] | 9 | 'The machine has two processor chips with 24 cores each.' |
Brad Bishop | a450b86 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 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 |
Matt Spinler | e495cb5 | 2018-02-19 15:46:39 -0600 | [diff] [blame] | 143 | oneshot: true |
Brad Bishop | a450b86 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 144 | |
| 145 | - name: log and shutdown |
| 146 | description: > |
| 147 | 'Shut the system down and log an event.' |
| 148 | class: callback |
| 149 | callback: group |
| 150 | members: |
| 151 | - shutdown |
Gunnar Mills | d35ec0e | 2017-08-09 13:22:02 -0500 | [diff] [blame] | 152 | - create criticalhigh error |
Gunnar Mills | 001b8fa | 2017-09-12 14:30:06 -0500 | [diff] [blame] | 153 | - create shutdown error |
Brad Bishop | a450b86 | 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: |
Matthew Barth | 21875f7 | 2017-10-17 09:53:47 -0500 | [diff] [blame] | 165 | - value: obmc-chassis-hard-poweroff@0.target |
Brad Bishop | a450b86 | 2017-06-28 14:23:12 -0400 | [diff] [blame] | 166 | type: string |
| 167 | - value: replace |
| 168 | type: string |
| 169 | |
Gunnar Mills | d35ec0e | 2017-08-09 13:22:02 -0500 | [diff] [blame] | 170 | - name: create criticalhigh error |
| 171 | description: > |
| 172 | 'Create a CriticalHigh Error log.' |
| 173 | class: callback |
Matt Spinler | e495cb5 | 2018-02-19 15:46:39 -0600 | [diff] [blame] | 174 | callback: elog_with_metadata |
Gunnar Mills | d35ec0e | 2017-08-09 13:22:02 -0500 | [diff] [blame] | 175 | paths: core sensors |
| 176 | properties: core temp |
| 177 | error: xyz::openbmc_project::Sensor::Threshold::Error::CriticalHigh |
Matt Spinler | e495cb5 | 2018-02-19 15:46:39 -0600 | [diff] [blame] | 178 | metadata: xyz::openbmc_project::Sensor::Threshold::CriticalHigh::SENSOR_DATA |
Gunnar Mills | 001b8fa | 2017-09-12 14:30:06 -0500 | [diff] [blame] | 179 | |
| 180 | - name: create shutdown error |
| 181 | description: > |
| 182 | 'Create a SystemShutdown Error log.' |
| 183 | class: callback |
| 184 | callback: elog |
| 185 | paths: core sensors |
| 186 | properties: core temp |
| 187 | error: xyz::openbmc_project::State::Shutdown::ThermalEvent::Error::Processor |