Lines Matching full:event
57 /* This pointer is handed to firmware as the event argument. */
76 struct sdei_event *event; member
81 #define CROSSCALL_INIT(arg, event) \ argument
83 arg.event = event; \
89 struct sdei_event *event) in sdei_do_local_call() argument
93 CROSSCALL_INIT(arg, event); in sdei_do_local_call()
100 struct sdei_event *event) in sdei_do_cross_call() argument
104 CROSSCALL_INIT(arg, event); in sdei_do_cross_call()
190 static int sdei_api_event_get_info(u32 event, u32 info, u64 *result) in sdei_api_event_get_info() argument
192 return invoke_sdei_fn(SDEI_1_0_FN_SDEI_EVENT_GET_INFO, event, info, 0, in sdei_api_event_get_info()
202 struct sdei_event *event; in sdei_event_create() local
207 event = kzalloc(sizeof(*event), GFP_KERNEL); in sdei_event_create()
208 if (!event) { in sdei_event_create()
213 INIT_LIST_HEAD(&event->list); in sdei_event_create()
214 event->event_num = event_num; in sdei_event_create()
220 event->priority = result; in sdei_event_create()
226 event->type = result; in sdei_event_create()
228 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_create()
235 reg->event_num = event->event_num; in sdei_event_create()
236 reg->priority = event->priority; in sdei_event_create()
240 event->registered = reg; in sdei_event_create()
254 reg->event_num = event->event_num; in sdei_event_create()
255 reg->priority = event->priority; in sdei_event_create()
260 event->private_registered = regs; in sdei_event_create()
264 list_add(&event->list, &sdei_list); in sdei_event_create()
267 return event; in sdei_event_create()
270 kfree(event); in sdei_event_create()
274 static void sdei_event_destroy_llocked(struct sdei_event *event) in sdei_event_destroy_llocked() argument
279 list_del(&event->list); in sdei_event_destroy_llocked()
281 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_destroy_llocked()
282 kfree(event->registered); in sdei_event_destroy_llocked()
284 free_percpu(event->private_registered); in sdei_event_destroy_llocked()
286 kfree(event); in sdei_event_destroy_llocked()
289 static void sdei_event_destroy(struct sdei_event *event) in sdei_event_destroy() argument
292 sdei_event_destroy_llocked(event); in sdei_event_destroy()
395 err = sdei_api_event_enable(arg->event->event_num); in _local_event_enable()
403 struct sdei_event *event; in sdei_event_enable() local
406 event = sdei_event_find(event_num); in sdei_event_enable()
407 if (!event) { in sdei_event_enable()
414 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_enable()
415 err = sdei_api_event_enable(event->event_num); in sdei_event_enable()
417 err = sdei_do_cross_call(_local_event_enable, event); in sdei_event_enable()
421 event->reenable = true; in sdei_event_enable()
441 err = sdei_api_event_disable(arg->event->event_num); in _ipi_event_disable()
449 struct sdei_event *event; in sdei_event_disable() local
452 event = sdei_event_find(event_num); in sdei_event_disable()
453 if (!event) { in sdei_event_disable()
459 event->reenable = false; in sdei_event_disable()
462 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_disable()
463 err = sdei_api_event_disable(event->event_num); in sdei_event_disable()
465 err = sdei_do_cross_call(_ipi_event_disable, event); in sdei_event_disable()
485 err = sdei_api_event_unregister(arg->event->event_num); in _local_event_unregister()
493 struct sdei_event *event; in sdei_event_unregister() local
498 event = sdei_event_find(event_num); in sdei_event_unregister()
499 if (!event) { in sdei_event_unregister()
500 pr_warn("Event %u not registered\n", event_num); in sdei_event_unregister()
506 event->reregister = false; in sdei_event_unregister()
507 event->reenable = false; in sdei_event_unregister()
510 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_event_unregister()
511 err = sdei_api_event_unregister(event->event_num); in sdei_event_unregister()
513 err = sdei_do_cross_call(_local_event_unregister, event); in sdei_event_unregister()
518 sdei_event_destroy(event); in sdei_event_unregister()
532 struct sdei_event *event; in sdei_unregister_shared() local
536 list_for_each_entry(event, &sdei_list, list) { in sdei_unregister_shared()
537 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_unregister_shared()
540 err = sdei_api_event_unregister(event->event_num); in sdei_unregister_shared()
567 reg = per_cpu_ptr(arg->event->private_registered, smp_processor_id()); in _local_event_register()
568 err = sdei_api_event_register(arg->event->event_num, sdei_entry_point, in _local_event_register()
577 struct sdei_event *event; in sdei_event_register() local
583 pr_warn("Event %u already registered\n", event_num); in sdei_event_register()
588 event = sdei_event_create(event_num, cb, arg); in sdei_event_register()
589 if (IS_ERR(event)) { in sdei_event_register()
590 err = PTR_ERR(event); in sdei_event_register()
591 pr_warn("Failed to create event %u: %d\n", event_num, err); in sdei_event_register()
596 if (event->type == SDEI_EVENT_TYPE_SHARED) { in sdei_event_register()
597 err = sdei_api_event_register(event->event_num, in sdei_event_register()
599 event->registered, in sdei_event_register()
602 err = sdei_do_cross_call(_local_event_register, event); in sdei_event_register()
604 sdei_do_cross_call(_local_event_unregister, event); in sdei_event_register()
608 sdei_event_destroy(event); in sdei_event_register()
609 pr_warn("Failed to register event %u: %d\n", event_num, err); in sdei_event_register()
614 event->reregister = true; in sdei_event_register()
626 struct sdei_event *event; in sdei_reregister_shared() local
630 list_for_each_entry(event, &sdei_list, list) { in sdei_reregister_shared()
631 if (event->type != SDEI_EVENT_TYPE_SHARED) in sdei_reregister_shared()
634 if (event->reregister) { in sdei_reregister_shared()
635 err = sdei_api_event_register(event->event_num, in sdei_reregister_shared()
636 sdei_entry_point, event->registered, in sdei_reregister_shared()
639 pr_err("Failed to re-register event %u\n", in sdei_reregister_shared()
640 event->event_num); in sdei_reregister_shared()
641 sdei_event_destroy_llocked(event); in sdei_reregister_shared()
646 if (event->reenable) { in sdei_reregister_shared()
647 err = sdei_api_event_enable(event->event_num); in sdei_reregister_shared()
649 pr_err("Failed to re-enable event %u\n", in sdei_reregister_shared()
650 event->event_num); in sdei_reregister_shared()
663 struct sdei_event *event; in sdei_cpuhp_down() local
668 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_down()
669 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_down()
672 err = sdei_do_local_call(_local_event_unregister, event); in sdei_cpuhp_down()
674 pr_err("Failed to unregister event %u: %d\n", in sdei_cpuhp_down()
675 event->event_num, err); in sdei_cpuhp_down()
685 struct sdei_event *event; in sdei_cpuhp_up() local
690 list_for_each_entry(event, &sdei_list, list) { in sdei_cpuhp_up()
691 if (event->type == SDEI_EVENT_TYPE_SHARED) in sdei_cpuhp_up()
694 if (event->reregister) { in sdei_cpuhp_up()
695 err = sdei_do_local_call(_local_event_register, event); in sdei_cpuhp_up()
697 pr_err("Failed to re-register event %u: %d\n", in sdei_cpuhp_up()
698 event->event_num, err); in sdei_cpuhp_up()
702 if (event->reenable) { in sdei_cpuhp_up()
703 err = sdei_do_local_call(_local_event_enable, event); in sdei_cpuhp_up()
705 pr_err("Failed to re-enable event %u: %d\n", in sdei_cpuhp_up()
706 event->event_num, err); in sdei_cpuhp_up()
870 * Event 0 is reserved by the specification for in sdei_register_ghes()
905 * The event may be running on another CPU. Disable it in sdei_unregister_ghes()
1110 pr_err_ratelimited("event %u on CPU %u failed with error: %d\n", in sdei_event_handler()