In Linux, the event management driver allows an agent driver to register handlers for the platform management events. These events can be power management events such as suspend callback, zero users, device state change, or any error event.
When an agent driver registers for the specific event, the event manager
registers those events with the firmware. When any of these registered events occurs,
the firmware notifies the TF-A through the IPI. The TF-A informs the Linux event manager
driver through the SGI. During the event manager driver initialization, it informs the
TF-A about which SGI to use for the communication though the
IOCTL EEMI API.
When the event manager driver gets the SGI interrupt, it reads the callback data to know which event has occurred and then calls the respective agent driver handler based on the event. The agent driver can unregister if it does not need to be notified for an event for which a handler was previously registered.