Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0d5d52c authored by Pushkar Joshi's avatar Pushkar Joshi
Browse files

soc: qcom: Service notification driver for remote services



Add a library for a kernel client to register and be notified of
any state changes regarding a local or remote service which runs
on a remote processor on the SoC.

Change-Id: Idd56140e11f4fdc48fd999a1e808f3263024f34d
Signed-off-by: default avatarPushkar Joshi <pushkarj@codeaurora.org>
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent eb310418
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
Introduction
=============

The service notifier driver facilitates a mechanism for a client
to register for state notifications regarding a particular remote service.
A remote service here refers to a process providing certain services like audio,
the identifier for which is provided by the service locator. The process
domain will typically run on a remote processor within the same SoC.

Software Description
=====================

The driver provides the following two APIs:
* service_notif_register_notifier() - Register a notifier for a service
  On success, it returns back a handle. It takes the following arguments:
  service_path: Individual service identifier path for which a client
		registers for notifications.
  instance_id: Instance id specific to a subsystem.
  current_state: Current state of service returned by the registration
		 process.
  notifier block: notifier callback for service events.

* service_notif_unregister_notifier() - Unregister a notifier for a service.
  This takes the handle returned during registration and the notifier block
  previously registered as the arguments.

Types of notifications:
=======================

A client can get either a SERVICE_DOWN notification or a SERVICE_UP
notification. A SERVICE_UP notification will be sent out when the SERVICE comes
up and is functional while a SERVICE_DOWN notification is sent after a
service ceases to exist. At the point a SERVICE_DOWN notification is sent out,
all the clients should assume that the service is already dead.

Interaction with SSR
=====================
In general, it is recommended that clients register for either service
notifications using the service notifier or SSR notifications, but not both.
In case it is necessary to register for both, the client can expect to get
the SERVICE_DOWN notification before the SUBSYS_AFTER_SHUTDOWN notification.
However, the client may receive the SUBSYS_BEFORE_SHUTDOWN notification
either before or after the SERVICE_DOWN notification.
+10 −0
Original line number Diff line number Diff line
@@ -584,6 +584,16 @@ config MSM_SERVICE_LOCATOR
	  to what process domain exports the service, and which subsystem
	  that process domain will execute in.

config MSM_SERVICE_NOTIFIER
	bool "Service Notifier"
	depends on MSM_SERVICE_LOCATOR && MSM_SUBSYSTEM_RESTART
	help
	  The Service Notifier provides a library for a kernel client to
	  register for state change notifications regarding a remote service.
	  A remote service here refers to a process providing certain services
	  like audio, the identifier for which is provided by the service
	  locator.

source "drivers/soc/qcom/memshare/Kconfig"

endif # ARCH_MSM
+2 −0
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ ifdef CONFIG_MSM_SUBSYSTEM_RESTART
	obj-y += subsystem_restart.o
	obj-y += ramdump.o
endif

obj-$(CONFIG_MSM_SUBSYSTEM_NOTIFIER) += service-notifier.o
obj-$(CONFIG_MSM_SYSMON_COMM) += sysmon.o sysmon-qmi.o
obj-$(CONFIG_MSM_SECURE_BUFFER) += secure_buffer.o
obj-$(CONFIG_TRACER_PKT) += tracer_pkt.o
+660 −0

File added.

Preview size limit exceeded, changes collapsed.

+303 −0

File added.

Preview size limit exceeded, changes collapsed.