Loading drivers/char/adsprpc.c +25 −9 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ struct fastrpc_apps { struct wakeup_source *wake_source; struct qos_cores silvercores; uint32_t max_size_limit; void *ramdump_handle; bool enable_ramdump; }; struct fastrpc_mmap { Loading Loading @@ -3178,7 +3180,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) match->size, match->flags); if (err) goto bail; if (me->channel[RH_CID].ramdumpenabled) { if (me->ramdump_handle && me->enable_ramdump) { ramdump_segments_rh = kcalloc(1, sizeof(struct ramdump_segment), GFP_KERNEL); if (ramdump_segments_rh) { Loading @@ -3186,7 +3188,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) match->phys; ramdump_segments_rh->size = match->size; ret = do_elf_ramdump( me->channel[RH_CID].rh_dump_dev, me->ramdump_handle, ramdump_segments_rh, 1); if (ret < 0) pr_err("adsprpc: %s: unable to dump heap (err %d)\n", Loading @@ -3197,6 +3199,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) fastrpc_mmap_free(match, 0); } } while (match); me->enable_ramdump = false; bail: if (err && match) fastrpc_mmap_add(match); Loading Loading @@ -4570,13 +4573,19 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb, mutex_unlock(&me->channel[cid].smd_mutex); } else if (code == SUBSYS_RAMDUMP_NOTIFICATION) { if (cid == RH_CID) { if (me->channel[RH_CID].rh_dump_dev && notifdata->enable_ramdump) { if (me->ramdump_handle) me->channel[RH_CID].ramdumpenabled = 1; } } pr_info("adsprpc: %s: received RAMDUMP notification for %s\n", __func__, gcinfo[cid].subsys); } else if (code == SUBSYS_BEFORE_POWERUP) { if (cid == RH_CID && notifdata->enable_ramdump) { if (me->ramdump_handle && me->channel[RH_CID] .ramdumpenabled) { me->enable_ramdump = true; me->channel[RH_CID].ramdumpenabled = 0; } } } else if (code == SUBSYS_AFTER_POWERUP) { pr_info("adsprpc: %s: %s subsystem is up\n", __func__, gcinfo[cid].subsys); Loading Loading @@ -4608,14 +4617,19 @@ static int fastrpc_pdr_notifier_cb(struct notifier_block *pdrnb, fastrpc_notify_pdr_drivers(me, spd->servloc_name); } else if (code == SUBSYS_RAMDUMP_NOTIFICATION) { if (spd->cid == RH_CID) { if (me->channel[RH_CID].rh_dump_dev && notifdata->enable_ramdump) { if (spd->cid == RH_CID && me->ramdump_handle) me->channel[RH_CID].ramdumpenabled = 1; } } pr_info("adsprpc: %s: received %s RAMDUMP notification for %s (%s)\n", __func__, gcinfo[spd->cid].subsys, spd->spdname, spd->servloc_name); } else if (code == SUBSYS_BEFORE_POWERUP) { if (spd->cid == RH_CID && notifdata->enable_ramdump) { if (me->ramdump_handle && me->channel[RH_CID] .ramdumpenabled) me->enable_ramdump = true; me->channel[RH_CID].ramdumpenabled = 0; } } else if (code == SERVREG_NOTIF_SERVICE_STATE_UP_V01) { pr_info("adsprpc: %s: %s (%s) is up on %s\n", __func__, spd->spdname, spd->servloc_name, Loading Loading @@ -4974,6 +4988,8 @@ static int fastrpc_probe(struct platform_device *pdev) me->range.addr = range.addr; me->range.size = range.size; } me->ramdump_handle = create_ramdump_device("adsp_rh", &pdev->dev); return 0; } me->legacy_remote_heap = of_property_read_bool(dev->of_node, Loading Loading
drivers/char/adsprpc.c +25 −9 Original line number Diff line number Diff line Loading @@ -394,6 +394,8 @@ struct fastrpc_apps { struct wakeup_source *wake_source; struct qos_cores silvercores; uint32_t max_size_limit; void *ramdump_handle; bool enable_ramdump; }; struct fastrpc_mmap { Loading Loading @@ -3178,7 +3180,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) match->size, match->flags); if (err) goto bail; if (me->channel[RH_CID].ramdumpenabled) { if (me->ramdump_handle && me->enable_ramdump) { ramdump_segments_rh = kcalloc(1, sizeof(struct ramdump_segment), GFP_KERNEL); if (ramdump_segments_rh) { Loading @@ -3186,7 +3188,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) match->phys; ramdump_segments_rh->size = match->size; ret = do_elf_ramdump( me->channel[RH_CID].rh_dump_dev, me->ramdump_handle, ramdump_segments_rh, 1); if (ret < 0) pr_err("adsprpc: %s: unable to dump heap (err %d)\n", Loading @@ -3197,6 +3199,7 @@ static int fastrpc_mmap_remove_ssr(struct fastrpc_file *fl) fastrpc_mmap_free(match, 0); } } while (match); me->enable_ramdump = false; bail: if (err && match) fastrpc_mmap_add(match); Loading Loading @@ -4570,13 +4573,19 @@ static int fastrpc_restart_notifier_cb(struct notifier_block *nb, mutex_unlock(&me->channel[cid].smd_mutex); } else if (code == SUBSYS_RAMDUMP_NOTIFICATION) { if (cid == RH_CID) { if (me->channel[RH_CID].rh_dump_dev && notifdata->enable_ramdump) { if (me->ramdump_handle) me->channel[RH_CID].ramdumpenabled = 1; } } pr_info("adsprpc: %s: received RAMDUMP notification for %s\n", __func__, gcinfo[cid].subsys); } else if (code == SUBSYS_BEFORE_POWERUP) { if (cid == RH_CID && notifdata->enable_ramdump) { if (me->ramdump_handle && me->channel[RH_CID] .ramdumpenabled) { me->enable_ramdump = true; me->channel[RH_CID].ramdumpenabled = 0; } } } else if (code == SUBSYS_AFTER_POWERUP) { pr_info("adsprpc: %s: %s subsystem is up\n", __func__, gcinfo[cid].subsys); Loading Loading @@ -4608,14 +4617,19 @@ static int fastrpc_pdr_notifier_cb(struct notifier_block *pdrnb, fastrpc_notify_pdr_drivers(me, spd->servloc_name); } else if (code == SUBSYS_RAMDUMP_NOTIFICATION) { if (spd->cid == RH_CID) { if (me->channel[RH_CID].rh_dump_dev && notifdata->enable_ramdump) { if (spd->cid == RH_CID && me->ramdump_handle) me->channel[RH_CID].ramdumpenabled = 1; } } pr_info("adsprpc: %s: received %s RAMDUMP notification for %s (%s)\n", __func__, gcinfo[spd->cid].subsys, spd->spdname, spd->servloc_name); } else if (code == SUBSYS_BEFORE_POWERUP) { if (spd->cid == RH_CID && notifdata->enable_ramdump) { if (me->ramdump_handle && me->channel[RH_CID] .ramdumpenabled) me->enable_ramdump = true; me->channel[RH_CID].ramdumpenabled = 0; } } else if (code == SERVREG_NOTIF_SERVICE_STATE_UP_V01) { pr_info("adsprpc: %s: %s (%s) is up on %s\n", __func__, spd->spdname, spd->servloc_name, Loading Loading @@ -4974,6 +4988,8 @@ static int fastrpc_probe(struct platform_device *pdev) me->range.addr = range.addr; me->range.size = range.size; } me->ramdump_handle = create_ramdump_device("adsp_rh", &pdev->dev); return 0; } me->legacy_remote_heap = of_property_read_bool(dev->of_node, Loading