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

Commit ab142790 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 b851c923
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -214,6 +214,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,
@@ -1300,12 +1304,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)