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

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

Merge "soc: qcom: pil: Add flag to know if modem SSR happened."

parents ca29376e d5e763cc
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -813,15 +813,19 @@ int pil_boot(struct pil_desc *desc)
	}

	if (desc->subsys_vmid > 0) {
		/* Make sure the memory is actually assigned to Linux. In the
		 * case where the shutdown sequence is not able to immediately
		 * assign the memory back to Linux, we need to do this here. */
		/**
		 * In case of modem ssr, we need to assign memory back to linux.
		 * This is not true after cold boot since linux already owns it.
		 * Also for secure boot devices, modem memory has to be released
		 * after MBA is booted
		 */
		if (desc->modem_ssr) {
			ret = pil_assign_mem_to_linux(desc, priv->region_start,
				(priv->region_end - priv->region_start));
			if (ret)
				pil_err(desc, "Failed to assign to linux, ret- %d\n",
								ret);

		}
		ret = pil_assign_mem_to_subsys_and_linux(desc,
				priv->region_start,
				(priv->region_end - priv->region_start));
@@ -857,6 +861,7 @@ int pil_boot(struct pil_desc *desc)
		goto err_auth_and_reset;
	}
	pil_info(desc, "Brought out of reset\n");
	desc->modem_ssr = false;
err_auth_and_reset:
	if (ret && desc->subsys_vmid > 0) {
		pil_assign_mem_to_linux(desc, priv->region_start,
@@ -917,6 +922,7 @@ void pil_shutdown(struct pil_desc *desc)
		pil_proxy_unvote(desc, 1);
	else
		flush_delayed_work(&priv->proxy);
	desc->modem_ssr = true;
}
EXPORT_SYMBOL(pil_shutdown);

+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ struct pil_priv;
 * @unmap_fw_mem: Custom function used to undo mapping by map_fw_mem.
 * This defaults to iounmap if not specified.
 * @shutdown_fail: Set if PIL op for shutting down subsystem fails.
 * @modem_ssr: true if modem is restarting, false if booting for first time.
 * @subsys_vmid: memprot id for the subsystem.
 */
struct pil_desc {
@@ -54,6 +55,7 @@ struct pil_desc {
	void (*unmap_fw_mem)(void *virt, size_t size, void *data);
	void *map_data;
	bool shutdown_fail;
	bool modem_ssr;
	u32 subsys_vmid;
};

+1 −0
Original line number Diff line number Diff line
@@ -214,6 +214,7 @@ static int pil_subsys_init(struct modem_data *drv,
	drv->subsys_desc.stop_ack_handler = modem_stop_ack_intr_handler;
	drv->subsys_desc.wdog_bite_handler = modem_wdog_bite_intr_handler;

	drv->q6->desc.modem_ssr = false;
	drv->subsys = subsys_register(&drv->subsys_desc);
	if (IS_ERR(drv->subsys)) {
		ret = PTR_ERR(drv->subsys);