• Home
  • Raw
  • Download

Lines Matching refs:ghes

97 static inline bool is_hest_type_generic_v2(struct ghes *ghes)  in is_hest_type_generic_v2()  argument
99 return ghes->generic->header.type == ACPI_HEST_TYPE_GENERIC_ERROR_V2; in is_hest_type_generic_v2()
198 static int map_gen_v2(struct ghes *ghes) in map_gen_v2() argument
200 return apei_map_generic_address(&ghes->generic_v2->read_ack_register); in map_gen_v2()
203 static void unmap_gen_v2(struct ghes *ghes) in unmap_gen_v2() argument
205 apei_unmap_generic_address(&ghes->generic_v2->read_ack_register); in unmap_gen_v2()
223 static struct ghes *ghes_new(struct acpi_hest_generic *generic) in ghes_new()
225 struct ghes *ghes; in ghes_new() local
229 ghes = kzalloc(sizeof(*ghes), GFP_KERNEL); in ghes_new()
230 if (!ghes) in ghes_new()
233 ghes->generic = generic; in ghes_new()
234 if (is_hest_type_generic_v2(ghes)) { in ghes_new()
235 rc = map_gen_v2(ghes); in ghes_new()
251 ghes->estatus = kmalloc(error_block_length, GFP_KERNEL); in ghes_new()
252 if (!ghes->estatus) { in ghes_new()
257 return ghes; in ghes_new()
262 if (is_hest_type_generic_v2(ghes)) in ghes_new()
263 unmap_gen_v2(ghes); in ghes_new()
265 kfree(ghes); in ghes_new()
269 static void ghes_fini(struct ghes *ghes) in ghes_fini() argument
271 kfree(ghes->estatus); in ghes_fini()
272 apei_unmap_generic_address(&ghes->generic->error_status_address); in ghes_fini()
273 if (is_hest_type_generic_v2(ghes)) in ghes_fini()
274 unmap_gen_v2(ghes); in ghes_fini()
319 static int __ghes_check_estatus(struct ghes *ghes, in __ghes_check_estatus() argument
329 if (len > ghes->generic->error_block_length) { in __ghes_check_estatus()
343 static int __ghes_peek_estatus(struct ghes *ghes, in __ghes_peek_estatus() argument
347 struct acpi_hest_generic *g = ghes->generic; in __ghes_peek_estatus()
385 static int ghes_read_estatus(struct ghes *ghes, in ghes_read_estatus() argument
391 rc = __ghes_peek_estatus(ghes, estatus, buf_paddr, fixmap_idx); in ghes_read_estatus()
395 rc = __ghes_check_estatus(ghes, estatus); in ghes_read_estatus()
403 static void ghes_clear_estatus(struct ghes *ghes, in ghes_clear_estatus() argument
420 if (is_hest_type_generic_v2(ghes)) in ghes_clear_estatus()
421 ghes_ack_error(ghes->generic_v2); in ghes_clear_estatus()
625 static bool ghes_do_proc(struct ghes *ghes, in ghes_do_proc() argument
840 static void __ghes_panic(struct ghes *ghes, in __ghes_panic() argument
844 __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus); in __ghes_panic()
846 ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx); in __ghes_panic()
854 static int ghes_proc(struct ghes *ghes) in ghes_proc() argument
856 struct acpi_hest_generic_status *estatus = ghes->estatus; in ghes_proc()
860 rc = ghes_read_estatus(ghes, estatus, &buf_paddr, FIX_APEI_GHES_IRQ); in ghes_proc()
865 __ghes_panic(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ); in ghes_proc()
868 if (ghes_print_estatus(NULL, ghes->generic, estatus)) in ghes_proc()
869 ghes_estatus_cache_add(ghes->generic, estatus); in ghes_proc()
871 ghes_do_proc(ghes, estatus); in ghes_proc()
874 ghes_clear_estatus(ghes, estatus, buf_paddr, FIX_APEI_GHES_IRQ); in ghes_proc()
879 static void ghes_add_timer(struct ghes *ghes) in ghes_add_timer() argument
881 struct acpi_hest_generic *g = ghes->generic; in ghes_add_timer()
890 ghes->timer.expires = round_jiffies_relative(expire); in ghes_add_timer()
891 add_timer(&ghes->timer); in ghes_add_timer()
896 struct ghes *ghes = from_timer(ghes, t, timer); in ghes_poll_func() local
900 ghes_proc(ghes); in ghes_poll_func()
902 if (!(ghes->flags & GHES_EXITING)) in ghes_poll_func()
903 ghes_add_timer(ghes); in ghes_poll_func()
908 struct ghes *ghes = data; in ghes_irq_func() local
913 rc = ghes_proc(ghes); in ghes_irq_func()
924 struct ghes *ghes; in ghes_notify_hed() local
930 list_for_each_entry_rcu(ghes, &ghes_hed, list) { in ghes_notify_hed()
931 if (!ghes_proc(ghes)) in ghes_notify_hed()
981 task_work_pending = ghes_do_proc(estatus_node->ghes, estatus); in ghes_proc_in_irq()
1028 static int ghes_in_nmi_queue_one_entry(struct ghes *ghes, in ghes_in_nmi_queue_one_entry() argument
1040 rc = __ghes_peek_estatus(ghes, &tmp_header, &buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1042 ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1046 rc = __ghes_check_estatus(ghes, &tmp_header); in ghes_in_nmi_queue_one_entry()
1048 ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1058 estatus_node->ghes = ghes; in ghes_in_nmi_queue_one_entry()
1059 estatus_node->generic = ghes->generic; in ghes_in_nmi_queue_one_entry()
1064 ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1072 __ghes_panic(ghes, estatus, buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1075 ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx); in ghes_in_nmi_queue_one_entry()
1096 struct ghes *ghes; in ghes_in_nmi_spool_from_list() local
1099 list_for_each_entry_rcu(ghes, rcu_list, list) { in ghes_in_nmi_spool_from_list()
1100 if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx)) in ghes_in_nmi_spool_from_list()
1130 static void ghes_sea_add(struct ghes *ghes) in ghes_sea_add() argument
1133 list_add_rcu(&ghes->list, &ghes_sea); in ghes_sea_add()
1137 static void ghes_sea_remove(struct ghes *ghes) in ghes_sea_remove() argument
1140 list_del_rcu(&ghes->list); in ghes_sea_remove()
1145 static inline void ghes_sea_add(struct ghes *ghes) { } in ghes_sea_add() argument
1146 static inline void ghes_sea_remove(struct ghes *ghes) { } in ghes_sea_remove() argument
1175 static void ghes_nmi_add(struct ghes *ghes) in ghes_nmi_add() argument
1180 list_add_rcu(&ghes->list, &ghes_nmi); in ghes_nmi_add()
1184 static void ghes_nmi_remove(struct ghes *ghes) in ghes_nmi_remove() argument
1187 list_del_rcu(&ghes->list); in ghes_nmi_remove()
1198 static inline void ghes_nmi_add(struct ghes *ghes) { } in ghes_nmi_add() argument
1199 static inline void ghes_nmi_remove(struct ghes *ghes) { } in ghes_nmi_remove() argument
1207 static int __ghes_sdei_callback(struct ghes *ghes, in __ghes_sdei_callback() argument
1210 if (!ghes_in_nmi_queue_one_entry(ghes, fixmap_idx)) { in __ghes_sdei_callback()
1223 struct ghes *ghes = arg; in ghes_sdei_normal_callback() local
1227 err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_NORMAL); in ghes_sdei_normal_callback()
1237 struct ghes *ghes = arg; in ghes_sdei_critical_callback() local
1241 err = __ghes_sdei_callback(ghes, FIX_APEI_GHES_SDEI_CRITICAL); in ghes_sdei_critical_callback()
1247 static int apei_sdei_register_ghes(struct ghes *ghes) in apei_sdei_register_ghes() argument
1252 return sdei_register_ghes(ghes, ghes_sdei_normal_callback, in apei_sdei_register_ghes()
1256 static int apei_sdei_unregister_ghes(struct ghes *ghes) in apei_sdei_unregister_ghes() argument
1261 return sdei_unregister_ghes(ghes); in apei_sdei_unregister_ghes()
1267 struct ghes *ghes = NULL; in ghes_probe() local
1323 ghes = ghes_new(generic); in ghes_probe()
1324 if (IS_ERR(ghes)) { in ghes_probe()
1325 rc = PTR_ERR(ghes); in ghes_probe()
1326 ghes = NULL; in ghes_probe()
1332 timer_setup(&ghes->timer, ghes_poll_func, 0); in ghes_probe()
1333 ghes_add_timer(ghes); in ghes_probe()
1337 rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq); in ghes_probe()
1343 rc = request_irq(ghes->irq, ghes_irq_func, IRQF_SHARED, in ghes_probe()
1344 "GHES IRQ", ghes); in ghes_probe()
1358 list_add_rcu(&ghes->list, &ghes_hed); in ghes_probe()
1363 ghes_sea_add(ghes); in ghes_probe()
1366 ghes_nmi_add(ghes); in ghes_probe()
1369 rc = apei_sdei_register_ghes(ghes); in ghes_probe()
1377 platform_set_drvdata(ghes_dev, ghes); in ghes_probe()
1379 ghes_edac_register(ghes, &ghes_dev->dev); in ghes_probe()
1383 ghes_proc(ghes); in ghes_probe()
1389 if (ghes) { in ghes_probe()
1390 ghes_fini(ghes); in ghes_probe()
1391 kfree(ghes); in ghes_probe()
1399 struct ghes *ghes; in ghes_remove() local
1402 ghes = platform_get_drvdata(ghes_dev); in ghes_remove()
1403 generic = ghes->generic; in ghes_remove()
1405 ghes->flags |= GHES_EXITING; in ghes_remove()
1408 del_timer_sync(&ghes->timer); in ghes_remove()
1411 free_irq(ghes->irq, ghes); in ghes_remove()
1418 list_del_rcu(&ghes->list); in ghes_remove()
1426 ghes_sea_remove(ghes); in ghes_remove()
1429 ghes_nmi_remove(ghes); in ghes_remove()
1432 rc = apei_sdei_unregister_ghes(ghes); in ghes_remove()
1441 ghes_fini(ghes); in ghes_remove()
1443 ghes_edac_unregister(ghes); in ghes_remove()
1445 kfree(ghes); in ghes_remove()