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

Commit 5bedc791 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: service-notifier: Create qmi_client per service path"

parents 75c4df08 9b26f81d
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ struct ind_req_resp {
 */
struct qmi_client_info {
	int instance_id;
	char service_path[SERVREG_NOTIF_NAME_LENGTH];
	enum pd_subsys_state subsys_state;
	struct work_struct ind_ack;
	struct work_struct new_server;
@@ -335,7 +336,8 @@ static void new_server_work(struct work_struct *work)
	mutex_lock(&notif_add_lock);
	mutex_lock(&service_list_lock);
	list_for_each_entry(service_notif, &service_list, list) {
		if (service_notif->instance_id == data->instance_id) {
		if (service_notif->instance_id == data->instance_id && !strcmp
			(service_notif->service_path, data->service_path)) {
			enum pd_subsys_state state = ROOT_PD_UP;

			rc = register_notif_listener(service_notif, data,
@@ -370,7 +372,8 @@ static void root_service_service_exit(struct qmi_client_info *data,
	mutex_lock(&notif_add_lock);
	mutex_lock(&service_list_lock);
	list_for_each_entry(service_notif, &service_list, list) {
		if (service_notif->instance_id == data->instance_id) {
		if (service_notif->instance_id == data->instance_id && !strcmp
			(data->service_path, service_notif->service_path)) {
			rc = service_notif_queue_notification(service_notif,
					SERVREG_NOTIF_SERVICE_STATE_DOWN_V01,
					&state);
@@ -469,7 +472,8 @@ static void *add_service_notif(const char *service_path, int instance_id,
	 */
	mutex_lock(&qmi_list_lock);
	list_for_each_entry(tmp, &qmi_client_list, list) {
		if (tmp->instance_id == instance_id) {
		if (tmp->instance_id == instance_id && !strcmp
				(tmp->service_path, service_path)) {
			if (tmp->service_connected) {
				rc = register_notif_listener(service_notif, tmp,
								curr_state);
@@ -495,6 +499,8 @@ static void *add_service_notif(const char *service_path, int instance_id,
	}

	qmi_data->instance_id = instance_id;
	strlcpy(qmi_data->service_path, service_path,
		ARRAY_SIZE(service_notif->service_path));
	qmi_data->svc_event_wq = create_singlethread_workqueue(subsys);
	if (!qmi_data->svc_event_wq) {
		rc = -ENOMEM;
@@ -625,7 +631,8 @@ int service_notif_pd_restart(const char *service_path, int instance_id)
	int rc = 0;

	list_for_each_entry(tmp, &qmi_client_list, list) {
		if (tmp->instance_id == instance_id) {
		if (tmp->instance_id == instance_id && !strcmp
				(tmp->service_path, service_path)) {
			if (tmp->service_connected) {
				pr_info("Restarting service %s, instance-id %d\n",
						service_path, instance_id);