Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89f432e6 authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

memshare: Fix parameters to collect ramdump



This patch defines condition for collecting ramdump
only when ramdump collection is enabled, modem is crashed
and memshare is notified of SUBSYS_RAMDUMP_NOTIFICATION.

CRs-Fixed: 1114015
Change-Id: I7e3ca0794980fd21cc0a5d890df4aeadfd5fbbbb
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent eb76995f
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -38,6 +38,7 @@ static void mem_share_svc_recv_msg(struct work_struct *work);
static DECLARE_DELAYED_WORK(work_recv_msg, mem_share_svc_recv_msg);
static struct workqueue_struct *mem_share_svc_workqueue;
static uint64_t bootup_request;
static bool ramdump_event;
static void *memshare_ramdump_dev[MAX_CLIENTS];

/* Memshare Driver Structure */
@@ -305,18 +306,25 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
		bootup_request++;
		break;

	case SUBSYS_RAMDUMP_NOTIFICATION:
		ramdump_event = 1;
		break;

	case SUBSYS_BEFORE_POWERUP:
		if (_cmd)
		if (_cmd) {
			notifdata = (struct notif_data *) _cmd;
		else
		} else {
			ramdump_event = 0;
			break;
		}

		if (notifdata->enable_ramdump) {
		if (notifdata->enable_ramdump && ramdump_event) {
			pr_info("memshare: %s, Ramdump collection is enabled\n",
					__func__);
			ret = mem_share_do_ramdump();
			if (ret)
				pr_err("Ramdump collection failed\n");
			ramdump_event = 0;
		}
		break;