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