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

Commit e6c9f162 authored by Karthikeyan Ramasubramanian's avatar Karthikeyan Ramasubramanian
Browse files

slimbus: Detach from IOMMU Context bank during SSR



After SSR, Slimbus driver re-attaches with IOMMU Context bank without
detaching. This repeated attach fails.

During SSR, detach from the IOMMU context bank before re-attaching.

CRs-Fixed: 2074236
Change-Id: Iaf0e7b31c99c2f195423b188edf8d4b0eb00a69e
Signed-off-by: default avatarKarthikeyan Ramasubramanian <kramasub@codeaurora.org>
parent a262fffa
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -182,6 +182,9 @@ 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;

	dev = ctrl_dev->iommu_desc.cb_dev;
	iommu_map = arm_iommu_create_mapping(&platform_bus_type,
						va_start, va_size);
@@ -1299,6 +1302,13 @@ void msm_slim_sps_exit(struct msm_slim_ctrl *dev, bool dereg)
		if (dev->pipes[i].connected)
			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)