summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPuja Gupta <pujag@codeaurora.org>2016-09-10 20:28:28 -0700
committerPuja Gupta <pujag@codeaurora.org>2016-09-13 18:43:40 -0700
commitd7532eb42e7b73e1b67b5be20a9fd3106cab263d (patch)
treec2a0ecbe44f1645321c99825ad56c492881306a8
parent9b82a4c5896632b62140d1ddda55638fea254007 (diff)
soc: qcom: Add subsys state with service notifier notification
Propagate subsystem state received from SSR notification back to the service notifier clients so they can know if subsystem crashed. CRs-Fixed: 1066446 Change-Id: I5418d298290623ac66a2b64108a1f5dab034e5f3 Signed-off-by: Puja Gupta <pujag@codeaurora.org>
-rw-r--r--drivers/soc/qcom/service-notifier.c16
-rw-r--r--include/soc/qcom/service-notifier.h5
2 files changed, 16 insertions, 5 deletions
diff --git a/drivers/soc/qcom/service-notifier.c b/drivers/soc/qcom/service-notifier.c
index 81dde8ca1ae8..981f78491ecf 100644
--- a/drivers/soc/qcom/service-notifier.c
+++ b/drivers/soc/qcom/service-notifier.c
@@ -386,7 +386,8 @@ static void root_service_service_arrive(struct work_struct *work)
mutex_unlock(&notif_add_lock);
}
-static void root_service_service_exit(struct qmi_client_info *data)
+static void root_service_service_exit(struct qmi_client_info *data,
+ enum pd_subsys_state state)
{
struct service_notif_info *service_notif = NULL;
int rc;
@@ -401,7 +402,7 @@ static void root_service_service_exit(struct qmi_client_info *data)
if (service_notif->instance_id == data->instance_id) {
rc = service_notif_queue_notification(service_notif,
SERVREG_NOTIF_SERVICE_STATE_DOWN_V01,
- NULL);
+ &state);
if (rc & NOTIFY_STOP_MASK)
pr_err("Notifier callback aborted for %s with error %d\n",
service_notif->service_path, rc);
@@ -425,7 +426,7 @@ static void root_service_exit_work(struct work_struct *work)
{
struct qmi_client_info *data = container_of(work,
struct qmi_client_info, svc_exit);
- root_service_service_exit(data);
+ root_service_service_exit(data, UNKNOWN);
}
static int service_event_notify(struct notifier_block *this,
@@ -456,10 +457,15 @@ static int ssr_event_notify(struct notifier_block *this,
{
struct qmi_client_info *info = container_of(this,
struct qmi_client_info, ssr_notifier);
+ struct notif_data *notif = data;
switch (code) {
case SUBSYS_BEFORE_SHUTDOWN:
- pr_debug("Root PD service Down (SSR notification)\n");
- root_service_service_exit(info);
+ pr_debug("Root PD DOWN(SSR notification), crashed?%d\n",
+ notif->crashed);
+ if (notif->crashed)
+ root_service_service_exit(info, CRASHED);
+ else
+ root_service_service_exit(info, SHUTDOWN);
break;
default:
break;
diff --git a/include/soc/qcom/service-notifier.h b/include/soc/qcom/service-notifier.h
index 598c91f7c9e2..eae879786d59 100644
--- a/include/soc/qcom/service-notifier.h
+++ b/include/soc/qcom/service-notifier.h
@@ -24,6 +24,11 @@ enum qmi_servreg_notif_service_state_enum_type_v01 {
SERVREG_NOTIF_SERVICE_STATE_UNINIT_V01 = 0x7FFFFFFF,
};
+enum pd_subsys_state {
+ CRASHED,
+ SHUTDOWN,
+ UNKNOWN,
+};
#if defined(CONFIG_MSM_SERVICE_NOTIFIER)
/* service_notif_register_notifier() - Register a notifier for a service