dsp-kernel: Adding locks while printing debug data
Add locking mechanism while printing file map and cma map in print debug data. Change-Id: I36484d763b56ec88413ca9394c08ff30d85e664a Signed-off-by: Ansa Ahmed <quic_ansa@quicinc.com>
This commit is contained in:
@@ -7716,6 +7716,27 @@ static void fastrpc_print_fastrpcbuf(struct fastrpc_buf *buf, void *buffer)
|
|||||||
buf->flags, buf->type, buf->in_use);
|
buf->flags, buf->type, buf->in_use);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fastrpc_print_map : Print fastrpc_map structure parameter.
|
||||||
|
* @args1: structure fastrpc_map, map whose details needs
|
||||||
|
* to because printed.
|
||||||
|
* @args1: buffer for storing the string consisting details
|
||||||
|
*/
|
||||||
|
static void fastrpc_print_map(struct fastrpc_mmap *map, void *buffer)
|
||||||
|
{
|
||||||
|
scnprintf(buffer +
|
||||||
|
strlen(buffer),
|
||||||
|
MINI_DUMP_DBG_SIZE -
|
||||||
|
strlen(buffer),
|
||||||
|
fastrpc_mmap_params,
|
||||||
|
map->fd,
|
||||||
|
map->flags, map->buf,
|
||||||
|
map->phys, map->size,
|
||||||
|
map->va, map->raddr,
|
||||||
|
map->len, map->refs,
|
||||||
|
map->secure);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fastrpc_print_debug_data : Print debug structure variable in CMA memory.
|
* fastrpc_print_debug_data : Print debug structure variable in CMA memory.
|
||||||
* Input cid: Channel id
|
* Input cid: Channel id
|
||||||
@@ -7797,19 +7818,17 @@ static void fastrpc_print_debug_data(int cid)
|
|||||||
MINI_DUMP_DBG_SIZE -
|
MINI_DUMP_DBG_SIZE -
|
||||||
strlen(mini_dump_buff),
|
strlen(mini_dump_buff),
|
||||||
"\nSession Maps\n");
|
"\nSession Maps\n");
|
||||||
hlist_for_each_entry_safe(map, n, &fl->maps, hn) {
|
hlist_for_each_entry_safe(map, n, &me->maps, hn) {
|
||||||
scnprintf(mini_dump_buff +
|
fastrpc_print_map(map, mini_dump_buff);
|
||||||
strlen(mini_dump_buff),
|
|
||||||
MINI_DUMP_DBG_SIZE -
|
|
||||||
strlen(mini_dump_buff),
|
|
||||||
fastrpc_mmap_params,
|
|
||||||
map->fd,
|
|
||||||
map->flags, map->buf,
|
|
||||||
map->phys, map->size,
|
|
||||||
map->va, map->raddr,
|
|
||||||
map->len, map->refs,
|
|
||||||
map->secure);
|
|
||||||
}
|
}
|
||||||
|
spin_unlock_irqrestore(&me->hlock, irq_flags);
|
||||||
|
mutex_lock(&fl->map_mutex);
|
||||||
|
hlist_for_each_entry_safe(map, n, &fl->maps, hn) {
|
||||||
|
fastrpc_print_map(map, mini_dump_buff);
|
||||||
|
}
|
||||||
|
mutex_unlock(&fl->map_mutex);
|
||||||
|
spin_lock_irqsave(&me->hlock, irq_flags);
|
||||||
|
spin_lock(&fl->hlock);
|
||||||
scnprintf(mini_dump_buff + strlen(mini_dump_buff),
|
scnprintf(mini_dump_buff + strlen(mini_dump_buff),
|
||||||
MINI_DUMP_DBG_SIZE - strlen(mini_dump_buff),
|
MINI_DUMP_DBG_SIZE - strlen(mini_dump_buff),
|
||||||
"\ncached_bufs\n");
|
"\ncached_bufs\n");
|
||||||
@@ -7846,7 +7865,6 @@ static void fastrpc_print_debug_data(int cid)
|
|||||||
"\nfl->secsctx->smmu.cb : %d\n",
|
"\nfl->secsctx->smmu.cb : %d\n",
|
||||||
fl->secsctx->smmu.cb);
|
fl->secsctx->smmu.cb);
|
||||||
}
|
}
|
||||||
spin_lock(&fl->hlock);
|
|
||||||
scnprintf(mini_dump_buff +
|
scnprintf(mini_dump_buff +
|
||||||
strlen(mini_dump_buff),
|
strlen(mini_dump_buff),
|
||||||
MINI_DUMP_DBG_SIZE -
|
MINI_DUMP_DBG_SIZE -
|
||||||
|
Reference in New Issue
Block a user