1 /* 2 * Copyright 2018 Advanced Micro Devices, Inc. 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 * 22 * 23 */ 24 #ifndef _AMDGPU_RAS_H 25 #define _AMDGPU_RAS_H 26 27 #include <linux/debugfs.h> 28 #include <linux/list.h> 29 #include "ta_ras_if.h" 30 #include "amdgpu_ras_eeprom.h" 31 #include "amdgpu_smuio.h" 32 #include "amdgpu_aca.h" 33 34 struct amdgpu_iv_entry; 35 36 #define AMDGPU_RAS_GPU_ERR_MEM_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 0, 0) 37 #define AMDGPU_RAS_GPU_ERR_FW_LOAD(x) AMDGPU_GET_REG_FIELD(x, 1, 1) 38 #define AMDGPU_RAS_GPU_ERR_WAFL_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 2, 2) 39 #define AMDGPU_RAS_GPU_ERR_XGMI_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 3, 3) 40 #define AMDGPU_RAS_GPU_ERR_USR_CP_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 4, 4) 41 #define AMDGPU_RAS_GPU_ERR_USR_DP_LINK_TRAINING(x) AMDGPU_GET_REG_FIELD(x, 5, 5) 42 #define AMDGPU_RAS_GPU_ERR_HBM_MEM_TEST(x) AMDGPU_GET_REG_FIELD(x, 6, 6) 43 #define AMDGPU_RAS_GPU_ERR_HBM_BIST_TEST(x) AMDGPU_GET_REG_FIELD(x, 7, 7) 44 #define AMDGPU_RAS_GPU_ERR_SOCKET_ID(x) AMDGPU_GET_REG_FIELD(x, 10, 8) 45 #define AMDGPU_RAS_GPU_ERR_AID_ID(x) AMDGPU_GET_REG_FIELD(x, 12, 11) 46 #define AMDGPU_RAS_GPU_ERR_HBM_ID(x) AMDGPU_GET_REG_FIELD(x, 13, 13) 47 #define AMDGPU_RAS_GPU_ERR_BOOT_STATUS(x) AMDGPU_GET_REG_FIELD(x, 31, 31) 48 49 #define AMDGPU_RAS_BOOT_STATUS_POLLING_LIMIT 1000 50 #define AMDGPU_RAS_BOOT_STEADY_STATUS 0xBA 51 #define AMDGPU_RAS_BOOT_STATUS_MASK 0xFF 52 #define AMDGPU_RAS_BOOT_SUCEESS 0x80000000 53 54 #define AMDGPU_RAS_FLAG_INIT_BY_VBIOS (0x1 << 0) 55 /* position of instance value in sub_block_index of 56 * ta_ras_trigger_error_input, the sub block uses lower 12 bits 57 */ 58 #define AMDGPU_RAS_INST_MASK 0xfffff000 59 #define AMDGPU_RAS_INST_SHIFT 0xc 60 61 #define AMDGPU_RAS_FEATURES_SOCKETID_SHIFT 29 62 #define AMDGPU_RAS_FEATURES_SOCKETID_MASK 0xe0000000 63 64 /* The high three bits indicates socketid */ 65 #define AMDGPU_RAS_GET_FEATURES(val) ((val) & ~AMDGPU_RAS_FEATURES_SOCKETID_MASK) 66 67 #define RAS_EVENT_LOG(_adev, _id, _fmt, ...) \ 68 do { \ 69 if (amdgpu_ras_event_id_is_valid((_adev), (_id))) \ 70 dev_info((_adev)->dev, "{%llu}" _fmt, (_id), ##__VA_ARGS__); \ 71 else \ 72 dev_info((_adev)->dev, _fmt, ##__VA_ARGS__); \ 73 } while (0) 74 75 enum amdgpu_ras_block { 76 AMDGPU_RAS_BLOCK__UMC = 0, 77 AMDGPU_RAS_BLOCK__SDMA, 78 AMDGPU_RAS_BLOCK__GFX, 79 AMDGPU_RAS_BLOCK__MMHUB, 80 AMDGPU_RAS_BLOCK__ATHUB, 81 AMDGPU_RAS_BLOCK__PCIE_BIF, 82 AMDGPU_RAS_BLOCK__HDP, 83 AMDGPU_RAS_BLOCK__XGMI_WAFL, 84 AMDGPU_RAS_BLOCK__DF, 85 AMDGPU_RAS_BLOCK__SMN, 86 AMDGPU_RAS_BLOCK__SEM, 87 AMDGPU_RAS_BLOCK__MP0, 88 AMDGPU_RAS_BLOCK__MP1, 89 AMDGPU_RAS_BLOCK__FUSE, 90 AMDGPU_RAS_BLOCK__MCA, 91 AMDGPU_RAS_BLOCK__VCN, 92 AMDGPU_RAS_BLOCK__JPEG, 93 AMDGPU_RAS_BLOCK__IH, 94 AMDGPU_RAS_BLOCK__MPIO, 95 96 AMDGPU_RAS_BLOCK__LAST 97 }; 98 99 enum amdgpu_ras_mca_block { 100 AMDGPU_RAS_MCA_BLOCK__MP0 = 0, 101 AMDGPU_RAS_MCA_BLOCK__MP1, 102 AMDGPU_RAS_MCA_BLOCK__MPIO, 103 AMDGPU_RAS_MCA_BLOCK__IOHC, 104 105 AMDGPU_RAS_MCA_BLOCK__LAST 106 }; 107 108 #define AMDGPU_RAS_BLOCK_COUNT AMDGPU_RAS_BLOCK__LAST 109 #define AMDGPU_RAS_MCA_BLOCK_COUNT AMDGPU_RAS_MCA_BLOCK__LAST 110 #define AMDGPU_RAS_BLOCK_MASK ((1ULL << AMDGPU_RAS_BLOCK_COUNT) - 1) 111 112 enum amdgpu_ras_gfx_subblock { 113 /* CPC */ 114 AMDGPU_RAS_BLOCK__GFX_CPC_INDEX_START = 0, 115 AMDGPU_RAS_BLOCK__GFX_CPC_SCRATCH = 116 AMDGPU_RAS_BLOCK__GFX_CPC_INDEX_START, 117 AMDGPU_RAS_BLOCK__GFX_CPC_UCODE, 118 AMDGPU_RAS_BLOCK__GFX_DC_STATE_ME1, 119 AMDGPU_RAS_BLOCK__GFX_DC_CSINVOC_ME1, 120 AMDGPU_RAS_BLOCK__GFX_DC_RESTORE_ME1, 121 AMDGPU_RAS_BLOCK__GFX_DC_STATE_ME2, 122 AMDGPU_RAS_BLOCK__GFX_DC_CSINVOC_ME2, 123 AMDGPU_RAS_BLOCK__GFX_DC_RESTORE_ME2, 124 AMDGPU_RAS_BLOCK__GFX_CPC_INDEX_END = 125 AMDGPU_RAS_BLOCK__GFX_DC_RESTORE_ME2, 126 /* CPF */ 127 AMDGPU_RAS_BLOCK__GFX_CPF_INDEX_START, 128 AMDGPU_RAS_BLOCK__GFX_CPF_ROQ_ME2 = 129 AMDGPU_RAS_BLOCK__GFX_CPF_INDEX_START, 130 AMDGPU_RAS_BLOCK__GFX_CPF_ROQ_ME1, 131 AMDGPU_RAS_BLOCK__GFX_CPF_TAG, 132 AMDGPU_RAS_BLOCK__GFX_CPF_INDEX_END = AMDGPU_RAS_BLOCK__GFX_CPF_TAG, 133 /* CPG */ 134 AMDGPU_RAS_BLOCK__GFX_CPG_INDEX_START, 135 AMDGPU_RAS_BLOCK__GFX_CPG_DMA_ROQ = 136 AMDGPU_RAS_BLOCK__GFX_CPG_INDEX_START, 137 AMDGPU_RAS_BLOCK__GFX_CPG_DMA_TAG, 138 AMDGPU_RAS_BLOCK__GFX_CPG_TAG, 139 AMDGPU_RAS_BLOCK__GFX_CPG_INDEX_END = AMDGPU_RAS_BLOCK__GFX_CPG_TAG, 140 /* GDS */ 141 AMDGPU_RAS_BLOCK__GFX_GDS_INDEX_START, 142 AMDGPU_RAS_BLOCK__GFX_GDS_MEM = AMDGPU_RAS_BLOCK__GFX_GDS_INDEX_START, 143 AMDGPU_RAS_BLOCK__GFX_GDS_INPUT_QUEUE, 144 AMDGPU_RAS_BLOCK__GFX_GDS_OA_PHY_CMD_RAM_MEM, 145 AMDGPU_RAS_BLOCK__GFX_GDS_OA_PHY_DATA_RAM_MEM, 146 AMDGPU_RAS_BLOCK__GFX_GDS_OA_PIPE_MEM, 147 AMDGPU_RAS_BLOCK__GFX_GDS_INDEX_END = 148 AMDGPU_RAS_BLOCK__GFX_GDS_OA_PIPE_MEM, 149 /* SPI */ 150 AMDGPU_RAS_BLOCK__GFX_SPI_SR_MEM, 151 /* SQ */ 152 AMDGPU_RAS_BLOCK__GFX_SQ_INDEX_START, 153 AMDGPU_RAS_BLOCK__GFX_SQ_SGPR = AMDGPU_RAS_BLOCK__GFX_SQ_INDEX_START, 154 AMDGPU_RAS_BLOCK__GFX_SQ_LDS_D, 155 AMDGPU_RAS_BLOCK__GFX_SQ_LDS_I, 156 AMDGPU_RAS_BLOCK__GFX_SQ_VGPR, 157 AMDGPU_RAS_BLOCK__GFX_SQ_INDEX_END = AMDGPU_RAS_BLOCK__GFX_SQ_VGPR, 158 /* SQC (3 ranges) */ 159 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX_START, 160 /* SQC range 0 */ 161 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX0_START = 162 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX_START, 163 AMDGPU_RAS_BLOCK__GFX_SQC_INST_UTCL1_LFIFO = 164 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX0_START, 165 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU0_WRITE_DATA_BUF, 166 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU0_UTCL1_LFIFO, 167 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU1_WRITE_DATA_BUF, 168 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU1_UTCL1_LFIFO, 169 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU2_WRITE_DATA_BUF, 170 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU2_UTCL1_LFIFO, 171 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX0_END = 172 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_CU2_UTCL1_LFIFO, 173 /* SQC range 1 */ 174 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX1_START, 175 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKA_TAG_RAM = 176 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX1_START, 177 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKA_UTCL1_MISS_FIFO, 178 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKA_MISS_FIFO, 179 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKA_BANK_RAM, 180 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_TAG_RAM, 181 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_HIT_FIFO, 182 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_MISS_FIFO, 183 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_DIRTY_BIT_RAM, 184 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_BANK_RAM, 185 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX1_END = 186 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKA_BANK_RAM, 187 /* SQC range 2 */ 188 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX2_START, 189 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKB_TAG_RAM = 190 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX2_START, 191 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKB_UTCL1_MISS_FIFO, 192 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKB_MISS_FIFO, 193 AMDGPU_RAS_BLOCK__GFX_SQC_INST_BANKB_BANK_RAM, 194 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_TAG_RAM, 195 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_HIT_FIFO, 196 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_MISS_FIFO, 197 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_DIRTY_BIT_RAM, 198 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_BANK_RAM, 199 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX2_END = 200 AMDGPU_RAS_BLOCK__GFX_SQC_DATA_BANKB_BANK_RAM, 201 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX_END = 202 AMDGPU_RAS_BLOCK__GFX_SQC_INDEX2_END, 203 /* TA */ 204 AMDGPU_RAS_BLOCK__GFX_TA_INDEX_START, 205 AMDGPU_RAS_BLOCK__GFX_TA_FS_DFIFO = 206 AMDGPU_RAS_BLOCK__GFX_TA_INDEX_START, 207 AMDGPU_RAS_BLOCK__GFX_TA_FS_AFIFO, 208 AMDGPU_RAS_BLOCK__GFX_TA_FL_LFIFO, 209 AMDGPU_RAS_BLOCK__GFX_TA_FX_LFIFO, 210 AMDGPU_RAS_BLOCK__GFX_TA_FS_CFIFO, 211 AMDGPU_RAS_BLOCK__GFX_TA_INDEX_END = AMDGPU_RAS_BLOCK__GFX_TA_FS_CFIFO, 212 /* TCA */ 213 AMDGPU_RAS_BLOCK__GFX_TCA_INDEX_START, 214 AMDGPU_RAS_BLOCK__GFX_TCA_HOLE_FIFO = 215 AMDGPU_RAS_BLOCK__GFX_TCA_INDEX_START, 216 AMDGPU_RAS_BLOCK__GFX_TCA_REQ_FIFO, 217 AMDGPU_RAS_BLOCK__GFX_TCA_INDEX_END = 218 AMDGPU_RAS_BLOCK__GFX_TCA_REQ_FIFO, 219 /* TCC (5 sub-ranges) */ 220 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX_START, 221 /* TCC range 0 */ 222 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX0_START = 223 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX_START, 224 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DATA = 225 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX0_START, 226 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DATA_BANK_0_1, 227 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DATA_BANK_1_0, 228 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DATA_BANK_1_1, 229 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DIRTY_BANK_0, 230 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_DIRTY_BANK_1, 231 AMDGPU_RAS_BLOCK__GFX_TCC_HIGH_RATE_TAG, 232 AMDGPU_RAS_BLOCK__GFX_TCC_LOW_RATE_TAG, 233 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX0_END = 234 AMDGPU_RAS_BLOCK__GFX_TCC_LOW_RATE_TAG, 235 /* TCC range 1 */ 236 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX1_START, 237 AMDGPU_RAS_BLOCK__GFX_TCC_IN_USE_DEC = 238 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX1_START, 239 AMDGPU_RAS_BLOCK__GFX_TCC_IN_USE_TRANSFER, 240 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX1_END = 241 AMDGPU_RAS_BLOCK__GFX_TCC_IN_USE_TRANSFER, 242 /* TCC range 2 */ 243 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX2_START, 244 AMDGPU_RAS_BLOCK__GFX_TCC_RETURN_DATA = 245 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX2_START, 246 AMDGPU_RAS_BLOCK__GFX_TCC_RETURN_CONTROL, 247 AMDGPU_RAS_BLOCK__GFX_TCC_UC_ATOMIC_FIFO, 248 AMDGPU_RAS_BLOCK__GFX_TCC_WRITE_RETURN, 249 AMDGPU_RAS_BLOCK__GFX_TCC_WRITE_CACHE_READ, 250 AMDGPU_RAS_BLOCK__GFX_TCC_SRC_FIFO, 251 AMDGPU_RAS_BLOCK__GFX_TCC_SRC_FIFO_NEXT_RAM, 252 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_TAG_PROBE_FIFO, 253 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX2_END = 254 AMDGPU_RAS_BLOCK__GFX_TCC_CACHE_TAG_PROBE_FIFO, 255 /* TCC range 3 */ 256 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX3_START, 257 AMDGPU_RAS_BLOCK__GFX_TCC_LATENCY_FIFO = 258 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX3_START, 259 AMDGPU_RAS_BLOCK__GFX_TCC_LATENCY_FIFO_NEXT_RAM, 260 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX3_END = 261 AMDGPU_RAS_BLOCK__GFX_TCC_LATENCY_FIFO_NEXT_RAM, 262 /* TCC range 4 */ 263 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX4_START, 264 AMDGPU_RAS_BLOCK__GFX_TCC_WRRET_TAG_WRITE_RETURN = 265 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX4_START, 266 AMDGPU_RAS_BLOCK__GFX_TCC_ATOMIC_RETURN_BUFFER, 267 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX4_END = 268 AMDGPU_RAS_BLOCK__GFX_TCC_ATOMIC_RETURN_BUFFER, 269 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX_END = 270 AMDGPU_RAS_BLOCK__GFX_TCC_INDEX4_END, 271 /* TCI */ 272 AMDGPU_RAS_BLOCK__GFX_TCI_WRITE_RAM, 273 /* TCP */ 274 AMDGPU_RAS_BLOCK__GFX_TCP_INDEX_START, 275 AMDGPU_RAS_BLOCK__GFX_TCP_CACHE_RAM = 276 AMDGPU_RAS_BLOCK__GFX_TCP_INDEX_START, 277 AMDGPU_RAS_BLOCK__GFX_TCP_LFIFO_RAM, 278 AMDGPU_RAS_BLOCK__GFX_TCP_CMD_FIFO, 279 AMDGPU_RAS_BLOCK__GFX_TCP_VM_FIFO, 280 AMDGPU_RAS_BLOCK__GFX_TCP_DB_RAM, 281 AMDGPU_RAS_BLOCK__GFX_TCP_UTCL1_LFIFO0, 282 AMDGPU_RAS_BLOCK__GFX_TCP_UTCL1_LFIFO1, 283 AMDGPU_RAS_BLOCK__GFX_TCP_INDEX_END = 284 AMDGPU_RAS_BLOCK__GFX_TCP_UTCL1_LFIFO1, 285 /* TD */ 286 AMDGPU_RAS_BLOCK__GFX_TD_INDEX_START, 287 AMDGPU_RAS_BLOCK__GFX_TD_SS_FIFO_LO = 288 AMDGPU_RAS_BLOCK__GFX_TD_INDEX_START, 289 AMDGPU_RAS_BLOCK__GFX_TD_SS_FIFO_HI, 290 AMDGPU_RAS_BLOCK__GFX_TD_CS_FIFO, 291 AMDGPU_RAS_BLOCK__GFX_TD_INDEX_END = AMDGPU_RAS_BLOCK__GFX_TD_CS_FIFO, 292 /* EA (3 sub-ranges) */ 293 AMDGPU_RAS_BLOCK__GFX_EA_INDEX_START, 294 /* EA range 0 */ 295 AMDGPU_RAS_BLOCK__GFX_EA_INDEX0_START = 296 AMDGPU_RAS_BLOCK__GFX_EA_INDEX_START, 297 AMDGPU_RAS_BLOCK__GFX_EA_DRAMRD_CMDMEM = 298 AMDGPU_RAS_BLOCK__GFX_EA_INDEX0_START, 299 AMDGPU_RAS_BLOCK__GFX_EA_DRAMWR_CMDMEM, 300 AMDGPU_RAS_BLOCK__GFX_EA_DRAMWR_DATAMEM, 301 AMDGPU_RAS_BLOCK__GFX_EA_RRET_TAGMEM, 302 AMDGPU_RAS_BLOCK__GFX_EA_WRET_TAGMEM, 303 AMDGPU_RAS_BLOCK__GFX_EA_GMIRD_CMDMEM, 304 AMDGPU_RAS_BLOCK__GFX_EA_GMIWR_CMDMEM, 305 AMDGPU_RAS_BLOCK__GFX_EA_GMIWR_DATAMEM, 306 AMDGPU_RAS_BLOCK__GFX_EA_INDEX0_END = 307 AMDGPU_RAS_BLOCK__GFX_EA_GMIWR_DATAMEM, 308 /* EA range 1 */ 309 AMDGPU_RAS_BLOCK__GFX_EA_INDEX1_START, 310 AMDGPU_RAS_BLOCK__GFX_EA_DRAMRD_PAGEMEM = 311 AMDGPU_RAS_BLOCK__GFX_EA_INDEX1_START, 312 AMDGPU_RAS_BLOCK__GFX_EA_DRAMWR_PAGEMEM, 313 AMDGPU_RAS_BLOCK__GFX_EA_IORD_CMDMEM, 314 AMDGPU_RAS_BLOCK__GFX_EA_IOWR_CMDMEM, 315 AMDGPU_RAS_BLOCK__GFX_EA_IOWR_DATAMEM, 316 AMDGPU_RAS_BLOCK__GFX_EA_GMIRD_PAGEMEM, 317 AMDGPU_RAS_BLOCK__GFX_EA_GMIWR_PAGEMEM, 318 AMDGPU_RAS_BLOCK__GFX_EA_INDEX1_END = 319 AMDGPU_RAS_BLOCK__GFX_EA_GMIWR_PAGEMEM, 320 /* EA range 2 */ 321 AMDGPU_RAS_BLOCK__GFX_EA_INDEX2_START, 322 AMDGPU_RAS_BLOCK__GFX_EA_MAM_D0MEM = 323 AMDGPU_RAS_BLOCK__GFX_EA_INDEX2_START, 324 AMDGPU_RAS_BLOCK__GFX_EA_MAM_D1MEM, 325 AMDGPU_RAS_BLOCK__GFX_EA_MAM_D2MEM, 326 AMDGPU_RAS_BLOCK__GFX_EA_MAM_D3MEM, 327 AMDGPU_RAS_BLOCK__GFX_EA_INDEX2_END = 328 AMDGPU_RAS_BLOCK__GFX_EA_MAM_D3MEM, 329 AMDGPU_RAS_BLOCK__GFX_EA_INDEX_END = 330 AMDGPU_RAS_BLOCK__GFX_EA_INDEX2_END, 331 /* UTC VM L2 bank */ 332 AMDGPU_RAS_BLOCK__UTC_VML2_BANK_CACHE, 333 /* UTC VM walker */ 334 AMDGPU_RAS_BLOCK__UTC_VML2_WALKER, 335 /* UTC ATC L2 2MB cache */ 336 AMDGPU_RAS_BLOCK__UTC_ATCL2_CACHE_2M_BANK, 337 /* UTC ATC L2 4KB cache */ 338 AMDGPU_RAS_BLOCK__UTC_ATCL2_CACHE_4K_BANK, 339 AMDGPU_RAS_BLOCK__GFX_MAX 340 }; 341 342 enum amdgpu_ras_error_type { 343 AMDGPU_RAS_ERROR__NONE = 0, 344 AMDGPU_RAS_ERROR__PARITY = 1, 345 AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE = 2, 346 AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE = 4, 347 AMDGPU_RAS_ERROR__POISON = 8, 348 }; 349 350 enum amdgpu_ras_ret { 351 AMDGPU_RAS_SUCCESS = 0, 352 AMDGPU_RAS_FAIL, 353 AMDGPU_RAS_UE, 354 AMDGPU_RAS_CE, 355 AMDGPU_RAS_PT, 356 }; 357 358 enum amdgpu_ras_error_query_mode { 359 AMDGPU_RAS_INVALID_ERROR_QUERY = 0, 360 AMDGPU_RAS_DIRECT_ERROR_QUERY = 1, 361 AMDGPU_RAS_FIRMWARE_ERROR_QUERY = 2, 362 }; 363 364 /* ras error status reisger fields */ 365 #define ERR_STATUS_LO__ERR_STATUS_VALID_FLAG__SHIFT 0x0 366 #define ERR_STATUS_LO__ERR_STATUS_VALID_FLAG_MASK 0x00000001L 367 #define ERR_STATUS_LO__MEMORY_ID__SHIFT 0x18 368 #define ERR_STATUS_LO__MEMORY_ID_MASK 0xFF000000L 369 #define ERR_STATUS_HI__ERR_INFO_VALID_FLAG__SHIFT 0x2 370 #define ERR_STATUS_HI__ERR_INFO_VALID_FLAG_MASK 0x00000004L 371 #define ERR_STATUS__ERR_CNT__SHIFT 0x17 372 #define ERR_STATUS__ERR_CNT_MASK 0x03800000L 373 374 #define AMDGPU_RAS_REG_ENTRY(ip, inst, reg_lo, reg_hi) \ 375 ip##_HWIP, inst, reg_lo##_BASE_IDX, reg_lo, reg_hi##_BASE_IDX, reg_hi 376 377 #define AMDGPU_RAS_REG_ENTRY_OFFSET(hwip, ip_inst, segment, reg) \ 378 (adev->reg_offset[hwip][ip_inst][segment] + (reg)) 379 380 #define AMDGPU_RAS_ERR_INFO_VALID (1 << 0) 381 #define AMDGPU_RAS_ERR_STATUS_VALID (1 << 1) 382 #define AMDGPU_RAS_ERR_ADDRESS_VALID (1 << 2) 383 384 #define AMDGPU_RAS_GPU_RESET_MODE2_RESET (0x1 << 0) 385 #define AMDGPU_RAS_GPU_RESET_MODE1_RESET (0x1 << 1) 386 387 struct amdgpu_ras_err_status_reg_entry { 388 uint32_t hwip; 389 uint32_t ip_inst; 390 uint32_t seg_lo; 391 uint32_t reg_lo; 392 uint32_t seg_hi; 393 uint32_t reg_hi; 394 uint32_t reg_inst; 395 uint32_t flags; 396 const char *block_name; 397 }; 398 399 struct amdgpu_ras_memory_id_entry { 400 uint32_t memory_id; 401 const char *name; 402 }; 403 404 struct ras_common_if { 405 enum amdgpu_ras_block block; 406 enum amdgpu_ras_error_type type; 407 uint32_t sub_block_index; 408 char name[32]; 409 }; 410 411 #define MAX_UMC_CHANNEL_NUM 32 412 413 struct ecc_info_per_ch { 414 uint16_t ce_count_lo_chip; 415 uint16_t ce_count_hi_chip; 416 uint64_t mca_umc_status; 417 uint64_t mca_umc_addr; 418 uint64_t mca_ceumc_addr; 419 }; 420 421 struct umc_ecc_info { 422 struct ecc_info_per_ch ecc[MAX_UMC_CHANNEL_NUM]; 423 424 /* Determine smu ecctable whether support 425 * record correctable error address 426 */ 427 int record_ce_addr_supported; 428 }; 429 430 enum ras_event_type { 431 RAS_EVENT_TYPE_INVALID = -1, 432 RAS_EVENT_TYPE_ISR = 0, 433 RAS_EVENT_TYPE_COUNT, 434 }; 435 436 struct ras_event_manager { 437 atomic64_t seqnos[RAS_EVENT_TYPE_COUNT]; 438 }; 439 440 struct ras_query_context { 441 enum ras_event_type type; 442 u64 event_id; 443 }; 444 445 struct amdgpu_ras { 446 /* ras infrastructure */ 447 /* for ras itself. */ 448 uint32_t features; 449 uint32_t schema; 450 struct list_head head; 451 /* sysfs */ 452 struct device_attribute features_attr; 453 struct device_attribute version_attr; 454 struct device_attribute schema_attr; 455 struct bin_attribute badpages_attr; 456 struct dentry *de_ras_eeprom_table; 457 /* block array */ 458 struct ras_manager *objs; 459 460 /* gpu recovery */ 461 struct work_struct recovery_work; 462 atomic_t in_recovery; 463 struct amdgpu_device *adev; 464 /* error handler data */ 465 struct ras_err_handler_data *eh_data; 466 struct mutex recovery_lock; 467 468 uint32_t flags; 469 bool reboot; 470 struct amdgpu_ras_eeprom_control eeprom_control; 471 472 bool error_query_ready; 473 474 /* bad page count threshold */ 475 uint32_t bad_page_cnt_threshold; 476 477 /* disable ras error count harvest in recovery */ 478 bool disable_ras_err_cnt_harvest; 479 480 /* is poison mode supported */ 481 bool poison_supported; 482 483 /* RAS count errors delayed work */ 484 struct delayed_work ras_counte_delay_work; 485 atomic_t ras_ue_count; 486 atomic_t ras_ce_count; 487 488 /* record umc error info queried from smu */ 489 struct umc_ecc_info umc_ecc; 490 491 /* Indicates smu whether need update bad channel info */ 492 bool update_channel_flag; 493 /* Record status of smu mca debug mode */ 494 bool is_aca_debug_mode; 495 496 /* Record special requirements of gpu reset caller */ 497 uint32_t gpu_reset_flags; 498 499 struct task_struct *page_retirement_thread; 500 wait_queue_head_t page_retirement_wq; 501 struct mutex page_retirement_lock; 502 atomic_t page_retirement_req_cnt; 503 struct mutex page_rsv_lock; 504 /* Fatal error detected flag */ 505 atomic_t fed; 506 507 /* RAS event manager */ 508 struct ras_event_manager __event_mgr; 509 struct ras_event_manager *event_mgr; 510 511 }; 512 513 struct ras_fs_data { 514 char sysfs_name[48]; 515 char debugfs_name[32]; 516 }; 517 518 struct ras_err_addr { 519 struct list_head node; 520 uint64_t err_status; 521 uint64_t err_ipid; 522 uint64_t err_addr; 523 }; 524 525 struct ras_err_info { 526 struct amdgpu_smuio_mcm_config_info mcm_info; 527 u64 ce_count; 528 u64 ue_count; 529 u64 de_count; 530 struct list_head err_addr_list; 531 }; 532 533 struct ras_err_node { 534 struct list_head node; 535 struct ras_err_info err_info; 536 }; 537 538 struct ras_err_data { 539 unsigned long ue_count; 540 unsigned long ce_count; 541 unsigned long de_count; 542 unsigned long err_addr_cnt; 543 struct eeprom_table_record *err_addr; 544 u32 err_list_count; 545 struct list_head err_node_list; 546 }; 547 548 #define for_each_ras_error(err_node, err_data) \ 549 list_for_each_entry(err_node, &(err_data)->err_node_list, node) 550 551 struct ras_err_handler_data { 552 /* point to bad page records array */ 553 struct eeprom_table_record *bps; 554 /* the count of entries */ 555 int count; 556 /* the space can place new entries */ 557 int space_left; 558 }; 559 560 typedef int (*ras_ih_cb)(struct amdgpu_device *adev, 561 void *err_data, 562 struct amdgpu_iv_entry *entry); 563 564 struct ras_ih_data { 565 /* interrupt bottom half */ 566 struct work_struct ih_work; 567 int inuse; 568 /* IP callback */ 569 ras_ih_cb cb; 570 /* full of entries */ 571 unsigned char *ring; 572 unsigned int ring_size; 573 unsigned int element_size; 574 unsigned int aligned_element_size; 575 unsigned int rptr; 576 unsigned int wptr; 577 }; 578 579 struct ras_manager { 580 struct ras_common_if head; 581 /* reference count */ 582 int use; 583 /* ras block link */ 584 struct list_head node; 585 /* the device */ 586 struct amdgpu_device *adev; 587 /* sysfs */ 588 struct device_attribute sysfs_attr; 589 int attr_inuse; 590 591 /* fs node name */ 592 struct ras_fs_data fs_data; 593 594 /* IH data */ 595 struct ras_ih_data ih_data; 596 597 struct ras_err_data err_data; 598 599 struct aca_handle aca_handle; 600 }; 601 602 struct ras_badpage { 603 unsigned int bp; 604 unsigned int size; 605 unsigned int flags; 606 }; 607 608 /* interfaces for IP */ 609 struct ras_fs_if { 610 struct ras_common_if head; 611 const char* sysfs_name; 612 char debugfs_name[32]; 613 }; 614 615 struct ras_query_if { 616 struct ras_common_if head; 617 unsigned long ue_count; 618 unsigned long ce_count; 619 unsigned long de_count; 620 }; 621 622 struct ras_inject_if { 623 struct ras_common_if head; 624 uint64_t address; 625 uint64_t value; 626 uint32_t instance_mask; 627 }; 628 629 struct ras_cure_if { 630 struct ras_common_if head; 631 uint64_t address; 632 }; 633 634 struct ras_ih_if { 635 struct ras_common_if head; 636 ras_ih_cb cb; 637 }; 638 639 struct ras_dispatch_if { 640 struct ras_common_if head; 641 struct amdgpu_iv_entry *entry; 642 }; 643 644 struct ras_debug_if { 645 union { 646 struct ras_common_if head; 647 struct ras_inject_if inject; 648 }; 649 int op; 650 }; 651 652 struct amdgpu_ras_block_object { 653 struct ras_common_if ras_comm; 654 655 int (*ras_block_match)(struct amdgpu_ras_block_object *block_obj, 656 enum amdgpu_ras_block block, uint32_t sub_block_index); 657 int (*ras_late_init)(struct amdgpu_device *adev, struct ras_common_if *ras_block); 658 void (*ras_fini)(struct amdgpu_device *adev, struct ras_common_if *ras_block); 659 ras_ih_cb ras_cb; 660 const struct amdgpu_ras_block_hw_ops *hw_ops; 661 }; 662 663 struct amdgpu_ras_block_hw_ops { 664 int (*ras_error_inject)(struct amdgpu_device *adev, 665 void *inject_if, uint32_t instance_mask); 666 void (*query_ras_error_count)(struct amdgpu_device *adev, void *ras_error_status); 667 void (*query_ras_error_status)(struct amdgpu_device *adev); 668 void (*query_ras_error_address)(struct amdgpu_device *adev, void *ras_error_status); 669 void (*reset_ras_error_count)(struct amdgpu_device *adev); 670 void (*reset_ras_error_status)(struct amdgpu_device *adev); 671 bool (*query_poison_status)(struct amdgpu_device *adev); 672 bool (*handle_poison_consumption)(struct amdgpu_device *adev); 673 }; 674 675 /* work flow 676 * vbios 677 * 1: ras feature enable (enabled by default) 678 * psp 679 * 2: ras framework init (in ip_init) 680 * IP 681 * 3: IH add 682 * 4: debugfs/sysfs create 683 * 5: query/inject 684 * 6: debugfs/sysfs remove 685 * 7: IH remove 686 * 8: feature disable 687 */ 688 689 690 int amdgpu_ras_recovery_init(struct amdgpu_device *adev); 691 692 void amdgpu_ras_resume(struct amdgpu_device *adev); 693 void amdgpu_ras_suspend(struct amdgpu_device *adev); 694 695 int amdgpu_ras_query_error_count(struct amdgpu_device *adev, 696 unsigned long *ce_count, 697 unsigned long *ue_count, 698 struct ras_query_if *query_info); 699 700 /* error handling functions */ 701 int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev, 702 struct eeprom_table_record *bps, int pages); 703 704 int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev, 705 unsigned long *new_cnt); 706 707 static inline enum ta_ras_block 708 amdgpu_ras_block_to_ta(enum amdgpu_ras_block block) { 709 switch (block) { 710 case AMDGPU_RAS_BLOCK__UMC: 711 return TA_RAS_BLOCK__UMC; 712 case AMDGPU_RAS_BLOCK__SDMA: 713 return TA_RAS_BLOCK__SDMA; 714 case AMDGPU_RAS_BLOCK__GFX: 715 return TA_RAS_BLOCK__GFX; 716 case AMDGPU_RAS_BLOCK__MMHUB: 717 return TA_RAS_BLOCK__MMHUB; 718 case AMDGPU_RAS_BLOCK__ATHUB: 719 return TA_RAS_BLOCK__ATHUB; 720 case AMDGPU_RAS_BLOCK__PCIE_BIF: 721 return TA_RAS_BLOCK__PCIE_BIF; 722 case AMDGPU_RAS_BLOCK__HDP: 723 return TA_RAS_BLOCK__HDP; 724 case AMDGPU_RAS_BLOCK__XGMI_WAFL: 725 return TA_RAS_BLOCK__XGMI_WAFL; 726 case AMDGPU_RAS_BLOCK__DF: 727 return TA_RAS_BLOCK__DF; 728 case AMDGPU_RAS_BLOCK__SMN: 729 return TA_RAS_BLOCK__SMN; 730 case AMDGPU_RAS_BLOCK__SEM: 731 return TA_RAS_BLOCK__SEM; 732 case AMDGPU_RAS_BLOCK__MP0: 733 return TA_RAS_BLOCK__MP0; 734 case AMDGPU_RAS_BLOCK__MP1: 735 return TA_RAS_BLOCK__MP1; 736 case AMDGPU_RAS_BLOCK__FUSE: 737 return TA_RAS_BLOCK__FUSE; 738 case AMDGPU_RAS_BLOCK__MCA: 739 return TA_RAS_BLOCK__MCA; 740 case AMDGPU_RAS_BLOCK__VCN: 741 return TA_RAS_BLOCK__VCN; 742 case AMDGPU_RAS_BLOCK__JPEG: 743 return TA_RAS_BLOCK__JPEG; 744 default: 745 WARN_ONCE(1, "RAS ERROR: unexpected block id %d\n", block); 746 return TA_RAS_BLOCK__UMC; 747 } 748 } 749 750 static inline enum ta_ras_error_type 751 amdgpu_ras_error_to_ta(enum amdgpu_ras_error_type error) { 752 switch (error) { 753 case AMDGPU_RAS_ERROR__NONE: 754 return TA_RAS_ERROR__NONE; 755 case AMDGPU_RAS_ERROR__PARITY: 756 return TA_RAS_ERROR__PARITY; 757 case AMDGPU_RAS_ERROR__SINGLE_CORRECTABLE: 758 return TA_RAS_ERROR__SINGLE_CORRECTABLE; 759 case AMDGPU_RAS_ERROR__MULTI_UNCORRECTABLE: 760 return TA_RAS_ERROR__MULTI_UNCORRECTABLE; 761 case AMDGPU_RAS_ERROR__POISON: 762 return TA_RAS_ERROR__POISON; 763 default: 764 WARN_ONCE(1, "RAS ERROR: unexpected error type %d\n", error); 765 return TA_RAS_ERROR__NONE; 766 } 767 } 768 769 /* called in ip_init and ip_fini */ 770 int amdgpu_ras_init(struct amdgpu_device *adev); 771 int amdgpu_ras_late_init(struct amdgpu_device *adev); 772 int amdgpu_ras_fini(struct amdgpu_device *adev); 773 int amdgpu_ras_pre_fini(struct amdgpu_device *adev); 774 775 int amdgpu_ras_block_late_init(struct amdgpu_device *adev, 776 struct ras_common_if *ras_block); 777 778 void amdgpu_ras_block_late_fini(struct amdgpu_device *adev, 779 struct ras_common_if *ras_block); 780 781 int amdgpu_ras_feature_enable(struct amdgpu_device *adev, 782 struct ras_common_if *head, bool enable); 783 784 int amdgpu_ras_feature_enable_on_boot(struct amdgpu_device *adev, 785 struct ras_common_if *head, bool enable); 786 787 int amdgpu_ras_sysfs_create(struct amdgpu_device *adev, 788 struct ras_common_if *head); 789 790 int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev, 791 struct ras_common_if *head); 792 793 void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev); 794 795 int amdgpu_ras_query_error_status(struct amdgpu_device *adev, 796 struct ras_query_if *info); 797 798 int amdgpu_ras_reset_error_count(struct amdgpu_device *adev, 799 enum amdgpu_ras_block block); 800 int amdgpu_ras_reset_error_status(struct amdgpu_device *adev, 801 enum amdgpu_ras_block block); 802 803 int amdgpu_ras_error_inject(struct amdgpu_device *adev, 804 struct ras_inject_if *info); 805 806 int amdgpu_ras_interrupt_add_handler(struct amdgpu_device *adev, 807 struct ras_common_if *head); 808 809 int amdgpu_ras_interrupt_remove_handler(struct amdgpu_device *adev, 810 struct ras_common_if *head); 811 812 int amdgpu_ras_interrupt_dispatch(struct amdgpu_device *adev, 813 struct ras_dispatch_if *info); 814 815 struct ras_manager *amdgpu_ras_find_obj(struct amdgpu_device *adev, 816 struct ras_common_if *head); 817 818 extern atomic_t amdgpu_ras_in_intr; 819 820 static inline bool amdgpu_ras_intr_triggered(void) 821 { 822 return !!atomic_read(&amdgpu_ras_in_intr); 823 } 824 825 static inline void amdgpu_ras_intr_cleared(void) 826 { 827 atomic_set(&amdgpu_ras_in_intr, 0); 828 } 829 830 void amdgpu_ras_global_ras_isr(struct amdgpu_device *adev); 831 832 void amdgpu_ras_set_error_query_ready(struct amdgpu_device *adev, bool ready); 833 834 bool amdgpu_ras_need_emergency_restart(struct amdgpu_device *adev); 835 836 void amdgpu_release_ras_context(struct amdgpu_device *adev); 837 838 int amdgpu_persistent_edc_harvesting_supported(struct amdgpu_device *adev); 839 840 const char *get_ras_block_str(struct ras_common_if *ras_block); 841 842 bool amdgpu_ras_is_poison_mode_supported(struct amdgpu_device *adev); 843 844 int amdgpu_ras_is_supported(struct amdgpu_device *adev, unsigned int block); 845 846 int amdgpu_ras_reset_gpu(struct amdgpu_device *adev); 847 848 struct amdgpu_ras* amdgpu_ras_get_context(struct amdgpu_device *adev); 849 850 int amdgpu_ras_set_context(struct amdgpu_device *adev, struct amdgpu_ras *ras_con); 851 852 int amdgpu_ras_set_mca_debug_mode(struct amdgpu_device *adev, bool enable); 853 int amdgpu_ras_set_aca_debug_mode(struct amdgpu_device *adev, bool enable); 854 bool amdgpu_ras_get_aca_debug_mode(struct amdgpu_device *adev); 855 bool amdgpu_ras_get_error_query_mode(struct amdgpu_device *adev, 856 unsigned int *mode); 857 858 int amdgpu_ras_register_ras_block(struct amdgpu_device *adev, 859 struct amdgpu_ras_block_object *ras_block_obj); 860 void amdgpu_ras_interrupt_fatal_error_handler(struct amdgpu_device *adev); 861 void amdgpu_ras_get_error_type_name(uint32_t err_type, char *err_type_name); 862 bool amdgpu_ras_inst_get_memory_id_field(struct amdgpu_device *adev, 863 const struct amdgpu_ras_err_status_reg_entry *reg_entry, 864 uint32_t instance, 865 uint32_t *memory_id); 866 bool amdgpu_ras_inst_get_err_cnt_field(struct amdgpu_device *adev, 867 const struct amdgpu_ras_err_status_reg_entry *reg_entry, 868 uint32_t instance, 869 unsigned long *err_cnt); 870 void amdgpu_ras_inst_query_ras_error_count(struct amdgpu_device *adev, 871 const struct amdgpu_ras_err_status_reg_entry *reg_list, 872 uint32_t reg_list_size, 873 const struct amdgpu_ras_memory_id_entry *mem_list, 874 uint32_t mem_list_size, 875 uint32_t instance, 876 uint32_t err_type, 877 unsigned long *err_count); 878 void amdgpu_ras_inst_reset_ras_error_count(struct amdgpu_device *adev, 879 const struct amdgpu_ras_err_status_reg_entry *reg_list, 880 uint32_t reg_list_size, 881 uint32_t instance); 882 883 int amdgpu_ras_error_data_init(struct ras_err_data *err_data); 884 void amdgpu_ras_error_data_fini(struct ras_err_data *err_data); 885 int amdgpu_ras_error_statistic_ce_count(struct ras_err_data *err_data, 886 struct amdgpu_smuio_mcm_config_info *mcm_info, 887 struct ras_err_addr *err_addr, u64 count); 888 int amdgpu_ras_error_statistic_ue_count(struct ras_err_data *err_data, 889 struct amdgpu_smuio_mcm_config_info *mcm_info, 890 struct ras_err_addr *err_addr, u64 count); 891 int amdgpu_ras_error_statistic_de_count(struct ras_err_data *err_data, 892 struct amdgpu_smuio_mcm_config_info *mcm_info, 893 struct ras_err_addr *err_addr, u64 count); 894 void amdgpu_ras_query_boot_status(struct amdgpu_device *adev, u32 num_instances); 895 int amdgpu_ras_bind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk, 896 const struct aca_info *aca_info, void *data); 897 int amdgpu_ras_unbind_aca(struct amdgpu_device *adev, enum amdgpu_ras_block blk); 898 899 ssize_t amdgpu_ras_aca_sysfs_read(struct device *dev, struct device_attribute *attr, 900 struct aca_handle *handle, char *buf, void *data); 901 902 void amdgpu_ras_add_mca_err_addr(struct ras_err_info *err_info, 903 struct ras_err_addr *err_addr); 904 905 void amdgpu_ras_del_mca_err_addr(struct ras_err_info *err_info, 906 struct ras_err_addr *mca_err_addr); 907 908 void amdgpu_ras_set_fed(struct amdgpu_device *adev, bool status); 909 bool amdgpu_ras_get_fed_status(struct amdgpu_device *adev); 910 911 bool amdgpu_ras_event_id_is_valid(struct amdgpu_device *adev, u64 id); 912 u64 amdgpu_ras_acquire_event_id(struct amdgpu_device *adev, enum ras_event_type type); 913 914 int amdgpu_ras_reserve_page(struct amdgpu_device *adev, uint64_t pfn); 915 916 #endif 917