summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */