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

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

Merge "qcom: subsystem_restart: Skip collecting ramdumps if a gpio bit is set"

parents 455e8035 d1327efa
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ Optional properties:
- qcom,gpio-force-stop: GPIO used by the apps to force the modem to shutdown.
- qcom,gpio-stop-ack: GPIO used by the modem to ack force stop or a graceful stop
		      to the apps.
- qcom,gpio-ramdump-disable: GPIO used by the modem to inform the apps that ramdump
			     collection should be disabled.
- qcom,restart-group: List of subsystems that will need to restart together.
- qcom,mba-image-is-not-elf:	Boolean- Present if MBA image doesnt use the ELF
				format.
+8 −0
Original line number Diff line number Diff line
@@ -113,6 +113,13 @@ static int modem_shutdown(const struct subsys_desc *subsys, bool force_stop)
		gpio_set_value(subsys->force_stop_gpio, 0);
	}

	if (drv->subsys_desc.ramdump_disable_gpio) {
		drv->subsys_desc.ramdump_disable = gpio_get_value(
					drv->subsys_desc.ramdump_disable_gpio);
		 pr_warn("Ramdump disable gpio value is %d\n",
			drv->subsys_desc.ramdump_disable);
	}

	pil_shutdown(&drv->q6->desc);

	return 0;
@@ -130,6 +137,7 @@ static int modem_powerup(const struct subsys_desc *subsys)
	 * to unset the flag below.
	 */
	INIT_COMPLETION(drv->stop_ack);
	drv->subsys_desc.ramdump_disable = 0;
	drv->ignore_errors = false;
	return pil_boot(&drv->q6->desc);
}
+15 −2
Original line number Diff line number Diff line
@@ -378,6 +378,14 @@ out:
	mutex_unlock(&restart_log_mutex);
}

static int is_ramdump_enabled(struct subsys_device *dev)
{
	if (dev->desc->ramdump_disable_gpio)
		return !dev->desc->ramdump_disable;

	return enable_ramdumps;
}

static void send_sysmon_notif(struct subsys_device *dev)
{
	struct subsys_device *subsys;
@@ -430,7 +438,7 @@ static void notify_each_subsys_device(struct subsys_device **list,
			send_sysmon_notif(dev);

		notif_data.crashed = subsys_get_crash_status(dev);
		notif_data.enable_ramdump = enable_ramdumps;
		notif_data.enable_ramdump = is_ramdump_enabled(dev);
		notif_data.no_auth = dev->desc->no_auth;
		notif_data.pdev = pdev;

@@ -502,7 +510,7 @@ static void subsystem_ramdump(struct subsys_device *dev, void *data)
	const char *name = dev->desc->name;

	if (dev->desc->ramdump)
		if (dev->desc->ramdump(enable_ramdumps, dev->desc) < 0)
		if (dev->desc->ramdump(is_ramdump_enabled(dev), dev->desc) < 0)
			pr_warn("%s[%p]: Ramdump failed.\n", name, current);
	dev->do_ramdump_on_put = false;
}
@@ -1310,6 +1318,11 @@ static int subsys_parse_devicetree(struct subsys_desc *desc)
	if (ret && ret != -ENOENT)
		return ret;

	ret = __get_gpio(desc, "qcom,gpio-ramdump-disable",
			&desc->ramdump_disable_gpio);
	if (ret && ret != -ENOENT)
		return ret;

	ret = platform_get_irq(pdev, 0);
	if (ret > 0)
		desc->wdog_bite_irq = ret;
+2 −0
Original line number Diff line number Diff line
@@ -65,6 +65,8 @@ struct subsys_desc {
	unsigned int stop_ack_irq;
	unsigned int wdog_bite_irq;
	int force_stop_gpio;
	int ramdump_disable_gpio;
	int ramdump_disable;
	bool no_auth;
	int ssctl_instance_id;
	u32 sysmon_pid;