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

Commit 379e4f2c authored by Shrey Vijay's avatar Shrey Vijay Committed by Dilip Kota
Browse files

slimbus-msm: Do IOMMU detach as part of power up



Do IOMMU detach as part of power up sequence instead of
power down, to avoid SMMU faults during SSR down while BAM
transactions are active.

Change-Id: If75752992c0156470886f109ca8151d8e3da7bc6
Signed-off-by: default avatarShrey Vijay <shreyv@codeaurora.org>
Signed-off-by: default avatarDilip Kota <dkota@codeaurora.org>
parent 01697ba5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2018, 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
@@ -256,6 +256,8 @@ static int dsp_domr_notify_cb(struct notifier_block *n, unsigned long code,
						dsp);
	struct pd_qmi_client_data *reg;

	/* Resetting the log level */
	SLIM_RST_LOGLVL(dev);
	SLIM_INFO(dev, "SLIM DSP SSR/PDR notify cb:0x%lx, type:%d\n",
			code, dsp->dom_t);
	switch (code) {
+6 −8
Original line number Diff line number Diff line
@@ -182,8 +182,12 @@ static int msm_slim_iommu_attach(struct msm_slim_ctrl *ctrl_dev)
	if (!ctrl_dev->iommu_desc.cb_dev)
		return 0;

	if (!IS_ERR_OR_NULL(ctrl_dev->iommu_desc.iommu_map))
		return 0;
	if (!IS_ERR_OR_NULL(ctrl_dev->iommu_desc.iommu_map)) {
		arm_iommu_detach_device(ctrl_dev->iommu_desc.cb_dev);
		arm_iommu_release_mapping(ctrl_dev->iommu_desc.iommu_map);
		ctrl_dev->iommu_desc.iommu_map = NULL;
		SLIM_INFO(ctrl_dev, "NGD IOMMU Dettach complete\n");
	}

	dev = ctrl_dev->iommu_desc.cb_dev;
	iommu_map = arm_iommu_create_mapping(&platform_bus_type,
@@ -1299,12 +1303,6 @@ void msm_slim_sps_exit(struct msm_slim_ctrl *dev, bool dereg)
			msm_slim_disconn_pipe_port(dev, i);
	}

	if (!IS_ERR_OR_NULL(dev->iommu_desc.iommu_map)) {
		arm_iommu_detach_device(dev->iommu_desc.cb_dev);
		arm_iommu_release_mapping(dev->iommu_desc.iommu_map);
		dev->iommu_desc.iommu_map = NULL;
	}

	if (dereg) {
		for (i = 0; i < dev->port_nums; i++) {
			if (dev->pipes[i].connected)