Add core SCMI Notifications dispatch and delivery support logic which is
able, at first, to dispatch well-known received events from the RX ISR to
the dedicated deferred worker, and then, from there, to final deliver the
events to the registered users' callbacks.
Dispatch and delivery is just added here, still not enabled.
Signed-off-by: Cristian Marussi <cristian.marussi@xxxxxxx>
---
V1 --> V2
- splitted out of V1 patch 04
- moved from IDR maps to real HashTables to store event_handlers
- simplified delivery logic
---
drivers/firmware/arm_scmi/notify.c | 242 ++++++++++++++++++++++++++++-
drivers/firmware/arm_scmi/notify.h | 22 +++
2 files changed, 262 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c
index 1339b6de0a4c..c2341c5304cf 100644
--- a/drivers/firmware/arm_scmi/notify.c
+++ b/drivers/firmware/arm_scmi/notify.c
@@ -48,13 +48,44 @@
* particular event coming only from a well defined source (like CPU vs GPU).
* When the source is not specified the user callback will be registered for
* all existing sources for that event (if any).
@@ -840,6 +1071,11 @@ static struct scmi_notify_ops notify_ops = {
*/
int scmi_notification_init(struct scmi_handle *handle)
{
+ scmi_notify_wq = alloc_workqueue("scmi_notify",
+ WQ_UNBOUND | WQ_FREEZABLE, 0);