diff options
author | Subin K G <subin.kg@ti.com> | 2011-10-25 10:51:34 +0800 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2011-10-25 10:51:34 +0800 |
commit | a51b8d1fc746414cbae7bbb517ac82b0354ad30d (patch) | |
tree | a9d328e4d79df5b39e9f72e470e8423fed0b9d4f | |
parent | 17224794ea80c7c41acf632f93f3fa76aa748a64 (diff) |
syslink: ipc: store pid in ipc drivers private data
Store the pid of process who call the ipc_open in it's private
data so at the time of release it can use this to send death
notification instead of using current pid whenever ipc release
has been called.
Change-Id: I86429112bd9668869ceeae43195309be2311ab5d
Signed-off-by: Subin K G <subin.kg@ti.com>
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
-rw-r--r-- | arch/arm/plat-omap/include/syslink/ipc_ioctl.h | 1 | ||||
-rw-r--r-- | drivers/dsp/syslink/multicore_ipc/ipc_drv.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/plat-omap/include/syslink/ipc_ioctl.h b/arch/arm/plat-omap/include/syslink/ipc_ioctl.h index 7230baf4ef8..ea2fdeac952 100644 --- a/arch/arm/plat-omap/include/syslink/ipc_ioctl.h +++ b/arch/arm/plat-omap/include/syslink/ipc_ioctl.h @@ -100,6 +100,7 @@ struct ipc_process_context { spinlock_t res_lock; struct ipc_device *dev; + pid_t tgid; }; void add_pr_res(struct ipc_process_context *pr_ctxt, unsigned int cmd, diff --git a/drivers/dsp/syslink/multicore_ipc/ipc_drv.c b/drivers/dsp/syslink/multicore_ipc/ipc_drv.c index d3c5a1b279e..23852f66f49 100644 --- a/drivers/dsp/syslink/multicore_ipc/ipc_drv.c +++ b/drivers/dsp/syslink/multicore_ipc/ipc_drv.c @@ -186,6 +186,7 @@ static int ipc_open(struct inode *inode, struct file *filp) dev = container_of(inode->i_cdev, struct ipc_device, cdev); pr_ctxt->dev = dev; + pr_ctxt->tgid = current->tgid; filp->private_data = pr_ctxt; } @@ -213,9 +214,9 @@ static int ipc_release(struct inode *inode, struct file *filp) goto err; } - ipc_notify_event(IPC_CLOSE, (void *)NULL); - pr_ctxt = filp->private_data; + ipc_notify_event(IPC_CLOSE, (void *)pr_ctxt->tgid); + list_for_each_entry_safe(info, temp, &pr_ctxt->resources, res) { retval = ipc_release_resource(info->cmd, (ulong)info->data, |