summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohit Aggarwal <maggarwa@codeaurora.org>2016-04-06 14:45:35 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-12 02:58:16 -0700
commitde93e6c399bf8336230fc76d9cb08ba6f25e2790 (patch)
treee59bb8e3b458d85e0e07ae58c5b9843fc73ae826
parent911e592fdc0d6c8f63ea2aec181122a5621d4cee (diff)
memshare: Synchronize memory allocation and free operations
Currently, on Modem SSR, memshare driver receives notification in which it free up the allocated memory. Due to timing issue, free is happening after allocation. This patch synchronize these operations. Change-Id: I464d3b82f33ccdfd0988ef33fec8414d4ab4a550 Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
-rw-r--r--drivers/soc/qcom/memshare/msm_memshare.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/soc/qcom/memshare/msm_memshare.c b/drivers/soc/qcom/memshare/msm_memshare.c
index f44f6f97ecdd..e1e91f56526d 100644
--- a/drivers/soc/qcom/memshare/msm_memshare.c
+++ b/drivers/soc/qcom/memshare/msm_memshare.c
@@ -203,6 +203,7 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
int dest_vmids[1] = {VMID_HLOS};
int dest_perms[1] = {PERM_READ|PERM_WRITE};
+ mutex_lock(&memsh_drv->mem_share);
switch (code) {
case SUBSYS_BEFORE_SHUTDOWN:
@@ -264,6 +265,7 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
break;
}
+ mutex_unlock(&memsh_drv->mem_share);
return NOTIFY_DONE;
}