Merge "adsprpc: Skip ramdump during PDR"

This commit is contained in:
qctecmdr
2024-03-14 13:30:54 -07:00
committed by Gerrit - the friendly Code Review server

View File

@@ -3983,7 +3983,7 @@ bail:
static int fastrpc_mmap_remove_pdr(struct fastrpc_file *fl);
static int fastrpc_channel_open(struct fastrpc_file *fl, uint32_t flags);
static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl, int locked);
static int fastrpc_dsp_restart_handler(struct fastrpc_file *fl, int locked, bool dump_req);
/*
* This function makes a call to create a thread group in the root
@@ -5189,7 +5189,7 @@ bail:
return err;
}
static int fastrpc_mmap_dump(struct fastrpc_mmap *map, struct fastrpc_file *fl, int locked)
static int fastrpc_mmap_dump(struct fastrpc_mmap *map, struct fastrpc_file *fl, int locked, bool dump_req)
{
struct fastrpc_mmap *match = map;
int err = 0, ret = 0;
@@ -5250,6 +5250,7 @@ static int fastrpc_mmap_dump(struct fastrpc_mmap *map, struct fastrpc_file *fl,
if (err)
return err;
}
if (dump_req) {
memset(&ramdump_segments_rh, 0, sizeof(ramdump_segments_rh));
ramdump_segments_rh.da = match->phys;
ramdump_segments_rh.va = (void *)page_address((struct page *)match->va);
@@ -5262,6 +5263,7 @@ static int fastrpc_mmap_dump(struct fastrpc_mmap *map, struct fastrpc_file *fl,
pr_err("adsprpc: %s: unable to dump heap (err %d)\n",
__func__, ret);
}
}
if (!match->is_persistent) {
if (!locked && fl)
mutex_lock(&fl->map_mutex);
@@ -5272,7 +5274,7 @@ static int fastrpc_mmap_dump(struct fastrpc_mmap *map, struct fastrpc_file *fl,
return 0;
}
static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl, int locked)
static int fastrpc_dsp_restart_handler(struct fastrpc_file *fl, int locked, bool dump_req)
{
struct fastrpc_mmap *match = NULL, *map = NULL;
struct hlist_node *n = NULL;
@@ -5307,7 +5309,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl, int locked)
}
spin_unlock_irqrestore(&me->hlock, irq_flags);
if (match)
err = fastrpc_mmap_dump(match, fl, locked);
err = fastrpc_mmap_dump(match, fl, locked, dump_req);
} while (match && !err);
bail:
@@ -5353,7 +5355,7 @@ static int fastrpc_mmap_remove_pdr(struct fastrpc_file *fl)
}
if (me->channel[cid].spd[session].pdrcount !=
me->channel[cid].spd[session].prevpdrcount) {
err = fastrpc_mmap_remove_ssr(fl, 0);
err = fastrpc_dsp_restart_handler(fl, 0, false);
if (err)
ADSPRPC_WARN("failed to unmap remote heap (err %d)\n",
err);
@@ -6393,7 +6395,7 @@ static int fastrpc_channel_open(struct fastrpc_file *fl, uint32_t flags)
me->channel[cid].prevssrcount) {
mutex_unlock(&me->channel[cid].smd_mutex);
mutex_lock(&fl->map_mutex);
err = fastrpc_mmap_remove_ssr(fl, 1);
err = fastrpc_dsp_restart_handler(fl, 1, true);
mutex_unlock(&fl->map_mutex);
if (err)
ADSPRPC_WARN(
@@ -8544,7 +8546,7 @@ static int fastrpc_hibernation_suspend(struct device *dev)
if (of_device_is_compatible(dev->of_node,
"qcom,msm-fastrpc-compute")) {
err = fastrpc_mmap_remove_ssr(NULL, 0);
err = fastrpc_dsp_restart_handler(NULL, 0, true);
if (err)
ADSPRPC_WARN("failed to unmap remote heap (err %d)\n",
err);