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: Shrey Vijay <shreyv@codeaurora.org>
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
This commit is contained in:
Shrey Vijay 2018-06-18 17:30:18 +05:30 • committed by Dilip Kota
commit ab142790f1
2 changed files with 8 additions and 8 deletions

View file

@ -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) {

View file

@ -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)