Merge "msm: ADSPRPC: Fix deadlock during SSR"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
f8963e38b3
@@ -3198,13 +3198,18 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl)
|
|||||||
kfree(ramdump_segments_rh);
|
kfree(ramdump_segments_rh);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mutex_lock(&fl->map_mutex);
|
||||||
fastrpc_mmap_free(match, 0);
|
fastrpc_mmap_free(match, 0);
|
||||||
|
mutex_unlock(&fl->map_mutex);
|
||||||
}
|
}
|
||||||
} while (match);
|
} while (match);
|
||||||
me->enable_ramdump = false;
|
me->enable_ramdump = false;
|
||||||
bail:
|
bail:
|
||||||
if (err && match)
|
if (err && match) {
|
||||||
|
mutex_lock(&fl->map_mutex);
|
||||||
fastrpc_mmap_add(match);
|
fastrpc_mmap_add(match);
|
||||||
|
mutex_unlock(&fl->map_mutex);
|
||||||
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4013,13 +4018,13 @@ static int fastrpc_channel_open(struct fastrpc_file *fl)
|
|||||||
|
|
||||||
if (cid == ADSP_DOMAIN_ID && me->channel[cid].ssrcount !=
|
if (cid == ADSP_DOMAIN_ID && me->channel[cid].ssrcount !=
|
||||||
me->channel[cid].prevssrcount) {
|
me->channel[cid].prevssrcount) {
|
||||||
mutex_lock(&fl->map_mutex);
|
mutex_unlock(&me->channel[cid].smd_mutex);
|
||||||
err = fastrpc_mmap_remove_ssr(fl);
|
err = fastrpc_mmap_remove_ssr(fl);
|
||||||
if (err)
|
if (err)
|
||||||
pr_warn("adsprpc: %s: %s: failed to unmap remote heap for %s (err %d)\n",
|
pr_warn("adsprpc: %s: %s: failed to unmap remote heap for %s (err %d)\n",
|
||||||
__func__, current->comm,
|
__func__, current->comm,
|
||||||
me->channel[cid].subsys, err);
|
me->channel[cid].subsys, err);
|
||||||
mutex_unlock(&fl->map_mutex);
|
mutex_lock(&me->channel[cid].smd_mutex);
|
||||||
me->channel[cid].prevssrcount =
|
me->channel[cid].prevssrcount =
|
||||||
me->channel[cid].ssrcount;
|
me->channel[cid].ssrcount;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user