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

Commit b246d3f3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom: smem: Rework SMEM ramdump logic"

parents 6cea18cf 26fcbad8
Loading
Loading
Loading
Loading
+25 −20
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/stat.h>
#include <soc/qcom/subsystem_notif.h>
#include <soc/qcom/subsystem_restart.h>
#include <soc/qcom/ramdump.h>

#include <soc/qcom/smem.h>
@@ -987,21 +988,24 @@ static int restart_notifier_cb(struct notifier_block *this,
				unsigned long code,
				void *data)
{
	if (code == SUBSYS_AFTER_SHUTDOWN) {
	struct restart_notifier_block *notifier;
	struct notif_data *notifdata = data;
	int ret;

	switch (code) {

	case SUBSYS_AFTER_SHUTDOWN:
		notifier = container_of(this,
					struct restart_notifier_block, nb);
		SMEM_INFO("%s: ssrestart for processor %d ('%s')\n",
				__func__, notifier->processor,
				notifier->name);

		remote_spin_release(&remote_spinlock, notifier->processor);
		remote_spin_release_all(notifier->processor);

		if (smem_ramdump_dev) {
			int ret;

		break;
	case SUBSYS_RAMDUMP_NOTIFICATION:
		if (!(smem_ramdump_dev && notifdata->enable_ramdump))
			break;
		SMEM_DBG("%s: saving ramdump\n", __func__);
		/*
		 * XPU protection does not currently allow the
@@ -1012,9 +1016,10 @@ static int restart_notifier_cb(struct notifier_block *this,
		ret = do_elf_ramdump(smem_ramdump_dev,
				smem_ramdump_segments, 1);
		if (ret < 0)
				LOG_ERR("%s: unable to dump smem %d\n",
								__func__, ret);
		}
			LOG_ERR("%s: unable to dump smem %d\n", __func__, ret);
		break;
	default:
		break;
	}

	return NOTIFY_DONE;