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

Commit df0f2dbc authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

memshare: Listen to SUBSYS_BEFORE_POWERUP to collect ramdump



Currently the XPU lock on memory allocated for memshare clients may not be
unlocked by MBA during SUBSYS_RAMDUMP_NOTIFICATION event and can result in
XPU violation while collecting ramdump.
This patch collects the ramdump on listening to SUBSYS_BEFORE_POWERUP
event.

CRs-Fixed: 1099029
Change-Id: I51732d5adc60ad106a44ba554818c18947e2e803
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent 67ca95e6
Loading
Loading
Loading
Loading
+15 −17
Original line number Diff line number Diff line
@@ -305,6 +305,21 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
		bootup_request++;
		break;

	case SUBSYS_BEFORE_POWERUP:
		if (_cmd)
			notifdata = (struct notif_data *) _cmd;
		else
			break;

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

	case SUBSYS_AFTER_POWERUP:
		pr_debug("memshare: Modem has booted up\n");
		for (i = 0; i < MAX_CLIENTS; i++) {
@@ -355,23 +370,6 @@ static int modem_notifier_cb(struct notifier_block *this, unsigned long code,
		bootup_request++;
		break;

		case SUBSYS_RAMDUMP_NOTIFICATION:

			if (_cmd)
				notifdata = (struct notif_data *) _cmd;
			else
				break;

			if (!(notifdata->enable_ramdump)) {
				pr_err("In %s, Ramdump collection is disabled\n",
						__func__);
			} else {
				ret = mem_share_do_ramdump();
				if (ret)
					pr_err("Ramdump collection failed\n");
			}
			break;

	default:
		pr_debug("Memshare: code: %lu\n", code);
		break;