From a51b8d1fc746414cbae7bbb517ac82b0354ad30d Mon Sep 17 00:00:00 2001 From: Subin K G Date: Tue, 25 Oct 2011 10:51:34 +0800 Subject: 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 Signed-off-by: Fernando Guzman Lugo --- arch/arm/plat-omap/include/syslink/ipc_ioctl.h | 1 + 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, -- cgit v1.2.3