iommu/arm-smmu: Updates probe defer handle from secure_buffer

- If probe_defer from secure_buffer received, we are raising the below
 warning from arm_smmu_assign_table.

arm_smmu_assign_table+0x124/0x130arm_smmu_attach_dev+0x9c8/0x1098
iommu_group_add_device+0x1ac/0x460
iommu_group_get_for_dev+0xc4/0x2b4
arm_smmu_add_device+0x330/0x4f8
iommu_probe_device+0x98/0x110
of_iommu_configure+0xac/0x1b4
of_dma_configure+0x198/0x320
platform_dma_configure+0x1c/0x30
really_probe+0x234/0x8a8
driver_probe_device+0x70/0x144
__device_attach_driver+0x138/0x1fc
bus_for_each_drv+0xa4/0x120

- with this change we will be clearing the smmu domain, if probe_defer
  from secure_buffer driver received.

Change-Id: Iad8a262e7d0ec8f49d94f521c4d43d3ec6931c8d
Signed-off-by: Faiyaz Mohammed <faiyazm@codeaurora.org>
This commit is contained in:
Faiyaz Mohammed 2020-05-08 17:24:58 +05:30 • committed by Gerrit - the friendly Code Review server
commit 3398816a64

View file

@ -1992,7 +1992,11 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain,
* during alloc_io_pgtable_ops
*/
arm_smmu_secure_domain_lock(smmu_domain);
arm_smmu_assign_table(smmu_domain);
ret = arm_smmu_assign_table(smmu_domain);
if (ret == -EPROBE_DEFER) {
arm_smmu_secure_domain_unlock(smmu_domain);
goto out_clear_smmu;
}
arm_smmu_secure_domain_unlock(smmu_domain);
/* Update the domain's page sizes to reflect the page table format */
@ -2480,6 +2484,10 @@ static int arm_smmu_assign_table(struct arm_smmu_domain *smmu_domain)
ret = hyp_assign_phys(virt_to_phys(pte_info->virt_addr),
PAGE_SIZE, &source_vmid, 1,
dest_vmids, dest_perms, 2);
if (ret == -EPROBE_DEFER)
return ret;
if (WARN_ON(ret))
break;
}
@ -2507,6 +2515,10 @@ static void arm_smmu_unassign_table(struct arm_smmu_domain *smmu_domain)
ret = hyp_assign_phys(virt_to_phys(pte_info->virt_addr),
PAGE_SIZE, source_vmlist, 2,
&dest_vmids, &dest_perms, 1);
if (ret == -EPROBE_DEFER)
return;
if (WARN_ON(ret))
break;
free_pages_exact(pte_info->virt_addr, pte_info->size);