diff --git a/dsp/adsprpc.c b/dsp/adsprpc.c index dc104c39c5..e06cbd1ea6 100644 --- a/dsp/adsprpc.c +++ b/dsp/adsprpc.c @@ -7716,6 +7716,27 @@ static void fastrpc_print_fastrpcbuf(struct fastrpc_buf *buf, void *buffer) 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. * Input cid: Channel id @@ -7797,19 +7818,17 @@ static void fastrpc_print_debug_data(int cid) MINI_DUMP_DBG_SIZE - strlen(mini_dump_buff), "\nSession Maps\n"); - hlist_for_each_entry_safe(map, n, &fl->maps, hn) { - scnprintf(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); + hlist_for_each_entry_safe(map, n, &me->maps, hn) { + fastrpc_print_map(map, mini_dump_buff); } + 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), MINI_DUMP_DBG_SIZE - strlen(mini_dump_buff), "\ncached_bufs\n"); @@ -7846,7 +7865,6 @@ static void fastrpc_print_debug_data(int cid) "\nfl->secsctx->smmu.cb : %d\n", fl->secsctx->smmu.cb); } - spin_lock(&fl->hlock); scnprintf(mini_dump_buff + strlen(mini_dump_buff), MINI_DUMP_DBG_SIZE -