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

Commit e3468380 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: dts: msm: Shutdown the external-mdm before the internal"

parents fdf85870 95200df2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -80,6 +80,18 @@ Optional properties:
			additional minidump entries that should be collected
			along with the subsystem's minidump.

- qcom,pon-depends-on: String that indicates the name of the subsystem that has
			to be powered-on before this subsystem is powered-on.
			If the dependednt subsystem is already powered-on,
			regardless of the fact that it's requested to power-on
			explicitly, the framework won't try to power it back up again.

- qcom,poff-depends-on: String that indicates the name of the subsystem that has
			to be powered-off before this subsystem is powered-off.
			If the dependednt subsystem is already powered-off,
			regardless of the fact that it's requested to power-off
			explicitly, the framework won't try to power it off again.

Example:
	qcom,venus@fdce0000 {
		compatible = "qcom,pil-tz-generic";
@@ -144,4 +156,7 @@ Example:
		qcom,gpio-force-stop = <&smp2pgpio_ssr_smp2p_2_out 0 0>;
		qcom,ssctl-instance-id = <14>;
		qcom,sysmon-id = <1>;

		/* Power-off venus before LPASS */
		qcom,poff-depends-on = "venus";
	};
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,10 @@
	qcom,mdm-link-info = "0305_01.01.00";
};

&pil_modem {
	qcom,poff-depends-on = "esoc0";
};

&wil6210 {
	status = "disabled";
};
+14 −7
Original line number Diff line number Diff line
/* Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2019, 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
@@ -982,7 +982,7 @@ void *__subsystem_get(const char *name, const char *fw_name)
		goto err_module;
	}

	subsys_d = subsystem_get(subsys->desc->depends_on);
	subsys_d = subsystem_get(subsys->desc->pon_depends_on);
	if (IS_ERR(subsys_d)) {
		retval = subsys_d;
		goto err_depends;
@@ -1061,6 +1061,10 @@ void subsystem_put(void *subsystem)
	if (IS_ERR_OR_NULL(subsys))
		return;

	subsys_d = find_subsys_device(subsys->desc->poff_depends_on);
	if (subsys_d)
		subsystem_put(subsys_d);

	track = subsys_get_track(subsys);
	mutex_lock(&track->lock);
	if (WARN(!subsys->count, "%s: %s: Reference count mismatch\n",
@@ -1074,11 +1078,6 @@ void subsystem_put(void *subsystem)
	}
	mutex_unlock(&track->lock);

	subsys_d = find_subsys_device(subsys->desc->depends_on);
	if (subsys_d) {
		subsystem_put(subsys_d);
		put_device(&subsys_d->dev);
	}
	module_put(subsys->owner);
	put_device(&subsys->dev);
	return;
@@ -1670,6 +1669,14 @@ static int subsys_parse_devicetree(struct subsys_desc *desc)
		return PTR_ERR(order);
	}

	if (of_property_read_string(pdev->dev.of_node, "qcom,pon-depends-on",
				&desc->pon_depends_on))
		pr_debug("pon-depends-on not set for %s\n", desc->name);

	if (of_property_read_string(pdev->dev.of_node, "qcom,poff-depends-on",
				&desc->poff_depends_on))
		pr_debug("poff-depends-on not set for %s\n", desc->name);

	return 0;
}

+9 −3
Original line number Diff line number Diff line
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2019, 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
@@ -63,7 +63,12 @@ struct subsys_notif_timeout {
 * struct subsys_desc - subsystem descriptor
 * @name: name of subsystem
 * @fw_name: firmware name
 * @depends_on: subsystem this subsystem depends on to operate
 * @pon_depends_on: subsystem this subsystem wants to power-on first. If the
 * dependednt subsystem is already powered-on, the framework won't try to power
 * it back up again.
 * @poff_depends_on: subsystem this subsystem wants to power-off first. If the
 * dependednt subsystem is already powered-off, the framework won't try to power
 * it off again.
 * @dev: parent device
 * @owner: module the descriptor belongs to
 * @shutdown: Stop a subsystem
@@ -87,7 +92,8 @@ struct subsys_notif_timeout {
struct subsys_desc {
	const char *name;
	char fw_name[256];
	const char *depends_on;
	const char *pon_depends_on;
	const char *poff_depends_on;
	struct device *dev;
	struct module *owner;