summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Peiffer <pierre.peiffer@stericsson.com>2012-01-11 14:30:50 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:07:05 +0200
commit8b5892ba062aa859fb8fedbcf3d49b421f3bec36 (patch)
treeb319a0f52966a530f713a1b0fa9158dd0053215b
parent2cb8bf74ea2ba80e42c575b121c4c5c906e83903 (diff)
U8500 CM: fix issue when task doing DSP dump dies
If the process doing the DSP dump abruptly dies, the dump is never acknoledged to the driver and all NMF activities remain blocked. Acknowledge the dump by resetting the dump_ongoing flag, if the process doing the dump closes the NMF driver, to unblock all NMF activities. ST-Ericsson ID: 409984 ST-Ericsson FOSS-OUT ID: Trivial ST-Ericsson Linux next: N/A Signed-off-by: Pierre Peiffer <pierre.peiffer@stericsson.com> Change-Id: I3ee4f016e3bc824685f79016c51409903dc21a43 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/45134 Reviewed-by: Pierre PEIFFER <pierre.peiffer@stericsson.com> Tested-by: Pierre PEIFFER <pierre.peiffer@stericsson.com> Reviewed-by: QABUILD
-rw-r--r--drivers/staging/nmf-cm/cm_service.c2
-rw-r--r--drivers/staging/nmf-cm/cmld.c10
-rw-r--r--drivers/staging/nmf-cm/cmld.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/staging/nmf-cm/cm_service.c b/drivers/staging/nmf-cm/cm_service.c
index a2a6ffa5b57..7335cccbd6a 100644
--- a/drivers/staging/nmf-cm/cm_service.c
+++ b/drivers/staging/nmf-cm/cm_service.c
@@ -65,7 +65,7 @@ void dispatch_service_msg(struct osal_msg *msg)
new_msg->d.srv.srvData.panic.panicSource
|= DEBUGFS_DUMP_FLAG;
dump_flag_to_set = false;
- cmld_dump_ongoing = true;
+ cmld_dump_ongoing = channelPriv->proc->pid;
}
#endif
spin_lock_bh(&channelPriv->bh_lock);
diff --git a/drivers/staging/nmf-cm/cmld.c b/drivers/staging/nmf-cm/cmld.c
index 60c20cadaee..d3a2f28ce4b 100644
--- a/drivers/staging/nmf-cm/cmld.c
+++ b/drivers/staging/nmf-cm/cmld.c
@@ -52,8 +52,8 @@ static DEFINE_MUTEX(channel_lock); /* lock used to protect previous list */
#ifdef CONFIG_DEBUG_FS
/* Debugfs support */
bool cmld_user_has_debugfs = false;
-bool cmld_dump_ongoing = false;
-module_param(cmld_dump_ongoing, bool, S_IWUSR|S_IRUGO);
+pid_t cmld_dump_ongoing = 0;
+module_param(cmld_dump_ongoing, uint, S_IWUSR|S_IRUGO);
static DECLARE_WAIT_QUEUE_HEAD(dump_waitq);
#endif
@@ -227,6 +227,10 @@ static void freeProcessPriv(struct kref *ref)
#ifdef CONFIG_DEBUG_FS
debugfs_remove_recursive(entry->dir);
+ if (cmld_dump_ongoing == entry->pid) {
+ cmld_dump_ongoing = 0;
+ wake_up(&dump_waitq);
+ }
#endif
/* Free the per-process descriptor */
@@ -387,7 +391,7 @@ static long cmld_control_ioctl(struct file *file, unsigned int cmd, unsigned lon
struct cm_process_priv* procPriv = file->private_data;
#ifdef CONFIG_DEBUG_FS
if (cmd == CM_PRIV_DEBUGFS_DUMP_DONE) {
- cmld_dump_ongoing = false;
+ cmld_dump_ongoing = 0;
wake_up(&dump_waitq);
return 0;
} else if (wait_event_interruptible(dump_waitq, (!cmld_dump_ongoing)))
diff --git a/drivers/staging/nmf-cm/cmld.h b/drivers/staging/nmf-cm/cmld.h
index 17e6c55ff61..78876bb01e6 100644
--- a/drivers/staging/nmf-cm/cmld.h
+++ b/drivers/staging/nmf-cm/cmld.h
@@ -76,7 +76,7 @@ extern struct list_head channel_list; /**< List of all allocated channel structu
extern struct list_head process_list; /**< List of all allocated process private structure */
#ifdef CONFIG_DEBUG_FS
extern bool cmld_user_has_debugfs; /**< Whether user side has proper support of debugfs to take a dump */
-extern bool cmld_dump_ongoing; /**< Whether a dump is on-going */
+extern pid_t cmld_dump_ongoing; /**< If a dump is on-going, store pid of process doing the dump */
#endif
/* Structure used to embed DSP traces */