On 25/08/2023 10:02, Vikram Garhwal wrote: > > > Add remove_device callback for removing the device entry from smmu-master > using > following steps: > 1. Find if SMMU master exists for the device node. > 2. Check if device is currently in use. Since you removed a call to iommu_dt_device_is_assigned_locked(), you do not check it from SMMU, right? You are relying on a check done in iommu_remove_dt_device(). This wants to be mentioned. However, Julien suggested to do the check for internal SMMU state. Looking at the code, when the device is assigned, we do: dev_iommu_domain(dev) = domain; and when de-assigned: dev_iommu_domain(dev) = NULL; This means that before calling remove_smmu_master() you could do: /* Make sure device is not assigned */ if (dev_iommu_domain(dev)) return -EBUSY; @Julien, @Stefano? ~Michal
- [XEN][PATCH v10 06/20] libfdt: Keep fdt functions after... Vikram Garhwal
- [XEN][PATCH v10 01/20] common/device_tree: handle memor... Vikram Garhwal
- [XEN][PATCH v10 09/20] xen/iommu: Move spin_lock from i... Vikram Garhwal
- [XEN][PATCH v10 14/20] common/device_tree: Add rwlock f... Vikram Garhwal
- Re: [XEN][PATCH v10 14/20] common/device_tree: Add... Vikram Garhwal
- Re: [XEN][PATCH v10 14/20] common/device_tree: Add... Michal Orzel
- [XEN][PATCH v10 13/20] asm/smp.h: Fix circular dependen... Vikram Garhwal
- [XEN][PATCH v10 12/20] xen/smmu: Add remove_device call... Vikram Garhwal
- Re: [XEN][PATCH v10 12/20] xen/smmu: Add remove_de... Michal Orzel
- Re: [XEN][PATCH v10 12/20] xen/smmu: Add remov... Stefano Stabellini
- Re: [XEN][PATCH v10 12/20] xen/smmu: Add r... Michal Orzel
- [XEN][PATCH v10 15/20] arm/asm/setup.h: Update struct m... Vikram Garhwal
- [XEN][PATCH v10 07/20] libfdt: overlay: change overlay_... Vikram Garhwal
- [XEN][PATCH v10 20/20] tools/xl: Add new xl command ove... Vikram Garhwal
- [XEN][PATCH v10 19/20] tools/libs/light: Implement new ... Vikram Garhwal
- [XEN][PATCH v10 18/20] tools/libs/ctrl: Implement new x... Vikram Garhwal
- [XEN][PATCH v10 17/20] xen/arm: Implement device tree n... Vikram Garhwal
- Re: [XEN][PATCH v10 17/20] xen/arm: Implement devi... Stefano Stabellini