|
@@ -237,6 +237,13 @@ enum fastrpc_proc_attr {
|
|
|
FASTRPC_MODE_SYSTEM_UNSIGNED_PD = 1 << 17,
|
|
|
};
|
|
|
|
|
|
+/* FastRPC remote subsystem state*/
|
|
|
+enum fastrpc_remote_subsys_state {
|
|
|
+ SUBSYSTEM_RESTARTING = 0,
|
|
|
+ SUBSYSTEM_DOWN,
|
|
|
+ SUBSYSTEM_UP,
|
|
|
+};
|
|
|
+
|
|
|
#define PERF_END ((void)0)
|
|
|
|
|
|
#define PERF(enb, cnt, ff) \
|
|
@@ -4373,7 +4380,7 @@ static int fastrpc_release_current_dsp_process(struct fastrpc_file *fl)
|
|
|
if (err)
|
|
|
goto bail;
|
|
|
|
|
|
- VERIFY(err, fl->apps->channel[cid].issubsystemup == 1);
|
|
|
+ VERIFY(err, fl->apps->channel[cid].subsystemstate != SUBSYSTEM_RESTARTING);
|
|
|
if (err) {
|
|
|
wait_for_completion(&fl->shutdown);
|
|
|
err = -ECONNRESET;
|
|
@@ -5612,8 +5619,8 @@ static ssize_t fastrpc_debugfs_read(struct file *filp, char __user *buffer,
|
|
|
len += scnprintf(fileinfo + len, DEBUGFS_SIZE - len,
|
|
|
"\n%s %s %s\n", title, " CHANNEL INFO ", title);
|
|
|
len += scnprintf(fileinfo + len, DEBUGFS_SIZE - len,
|
|
|
- "%-7s|%-10s|%-14s|%-9s|%-13s\n",
|
|
|
- "subsys", "sesscount", "issubsystemup",
|
|
|
+ "%-7s|%-10s|%-15s|%-9s|%-13s\n",
|
|
|
+ "subsys", "sesscount", "subsystemstate",
|
|
|
"ssrcount", "session_used");
|
|
|
len += scnprintf(fileinfo + len, DEBUGFS_SIZE - len,
|
|
|
"-%s%s%s%s-\n", single_line, single_line,
|
|
@@ -5627,8 +5634,8 @@ static ssize_t fastrpc_debugfs_read(struct file *filp, char __user *buffer,
|
|
|
DEBUGFS_SIZE - len, "|%-10u",
|
|
|
chan->sesscount);
|
|
|
len += scnprintf(fileinfo + len,
|
|
|
- DEBUGFS_SIZE - len, "|%-14d",
|
|
|
- chan->issubsystemup);
|
|
|
+ DEBUGFS_SIZE - len, "|%-15d",
|
|
|
+ chan->subsystemstate);
|
|
|
len += scnprintf(fileinfo + len,
|
|
|
DEBUGFS_SIZE - len, "|%-9u",
|
|
|
chan->ssrcount);
|
|
@@ -5859,7 +5866,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl, uint32_t flags)
|
|
|
mutex_lock(&me->channel[cid].smd_mutex);
|
|
|
if (me->channel[cid].ssrcount !=
|
|
|
me->channel[cid].prevssrcount) {
|
|
|
- if (!me->channel[cid].issubsystemup) {
|
|
|
+ if (me->channel[cid].subsystemstate != SUBSYSTEM_UP) {
|
|
|
err = -ECONNREFUSED;
|
|
|
mutex_unlock(&me->channel[cid].smd_mutex);
|
|
|
goto bail;
|
|
@@ -7291,7 +7298,7 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb,
|
|
|
__func__, gcinfo[cid].subsys);
|
|
|
mutex_lock(&me->channel[cid].smd_mutex);
|
|
|
ctx->ssrcount++;
|
|
|
- ctx->issubsystemup = 0;
|
|
|
+ ctx->subsystemstate = SUBSYSTEM_RESTARTING;
|
|
|
mutex_unlock(&me->channel[cid].smd_mutex);
|
|
|
if (cid == RH_CID)
|
|
|
me->staticpd_flags = 0;
|
|
@@ -7306,6 +7313,7 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb,
|
|
|
complete(&fl->shutdown);
|
|
|
}
|
|
|
spin_unlock(&me->hlock);
|
|
|
+ ctx->subsystemstate = SUBSYSTEM_DOWN;
|
|
|
pr_info("adsprpc: %s: received RAMDUMP notification for %s\n",
|
|
|
__func__, gcinfo[cid].subsys);
|
|
|
break;
|
|
@@ -7335,7 +7343,7 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb,
|
|
|
"QCOM_SSR_AFTER_POWERUP", "fastrpc_restart_notifier-enter");
|
|
|
pr_info("adsprpc: %s: %s subsystem is up\n",
|
|
|
__func__, gcinfo[cid].subsys);
|
|
|
- ctx->issubsystemup = 1;
|
|
|
+ ctx->subsystemstate = SUBSYSTEM_UP;
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -8352,7 +8360,7 @@ static int __init fastrpc_device_init(void)
|
|
|
me->channel[i].ssrcount = 0;
|
|
|
me->channel[i].in_hib = 0;
|
|
|
me->channel[i].prevssrcount = 0;
|
|
|
- me->channel[i].issubsystemup = 1;
|
|
|
+ me->channel[i].subsystemstate = SUBSYSTEM_UP;
|
|
|
me->channel[i].rh_dump_dev = NULL;
|
|
|
me->channel[i].nb.notifier_call = fastrpc_restart_notifier_cb;
|
|
|
me->channel[i].handle = qcom_register_ssr_notifier(
|