Merge "soc: qcom: Add subsys state with service notifier notification"
This commit is contained in:
commit
4886f3b04b
2 changed files with 16 additions and 5 deletions
|
@ -386,7 +386,8 @@ static void root_service_service_arrive(struct work_struct *work)
|
|||
mutex_unlock(¬if_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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue