Re: [PATCH v2 05/10] iommu: Remove apply_resv_region

2022-02-09 Thread Jason Gunthorpe via iommu
On Tue, Feb 08, 2022 at 09:25:54AM +0800, Lu Baolu wrote:
> The apply_resv_region callback in iommu_ops was introduced to reserve an
> IOVA range in the given DMA domain when the IOMMU driver manages the IOVA
> by itself. As all drivers converted to use dma-iommu in the core, there's
> no driver using this anymore. Remove it to avoid dead code.
> 
> Suggested-by: Robin Murphy 
> Signed-off-by: Lu Baolu 
> ---
>  include/linux/iommu.h | 4 
>  drivers/iommu/iommu.c | 3 ---
>  2 files changed, 7 deletions(-)

Reviewed-by: Jason Gunthorpe 

Jason
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2 05/10] iommu: Remove apply_resv_region

2022-02-08 Thread Christoph Hellwig
Looks good,

Reviewed-by: Christoph Hellwig 
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


[PATCH v2 05/10] iommu: Remove apply_resv_region

2022-02-07 Thread Lu Baolu
The apply_resv_region callback in iommu_ops was introduced to reserve an
IOVA range in the given DMA domain when the IOMMU driver manages the IOVA
by itself. As all drivers converted to use dma-iommu in the core, there's
no driver using this anymore. Remove it to avoid dead code.

Suggested-by: Robin Murphy 
Signed-off-by: Lu Baolu 
---
 include/linux/iommu.h | 4 
 drivers/iommu/iommu.c | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 9983a01373b2..9ffa2e88f3d0 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -214,7 +214,6 @@ struct iommu_iotlb_gather {
  * @set_pgtable_quirks: Set io page table quirks (IO_PGTABLE_QUIRK_*)
  * @get_resv_regions: Request list of reserved regions for a device
  * @put_resv_regions: Free list of reserved regions for a device
- * @apply_resv_region: Temporary helper call-back for iova reserved ranges
  * @of_xlate: add OF master IDs to iommu grouping
  * @is_attach_deferred: Check if domain attach should be deferred from iommu
  *  driver init to device driver init (default no)
@@ -268,9 +267,6 @@ struct iommu_ops {
/* Request/Free a list of reserved regions for a device */
void (*get_resv_regions)(struct device *dev, struct list_head *list);
void (*put_resv_regions)(struct device *dev, struct list_head *list);
-   void (*apply_resv_region)(struct device *dev,
- struct iommu_domain *domain,
- struct iommu_resv_region *region);
 
int (*of_xlate)(struct device *dev, struct of_phandle_args *args);
bool (*is_attach_deferred)(struct iommu_domain *domain, struct device 
*dev);
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index cf54dc925827..df6bd1d58c74 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -785,9 +785,6 @@ static int iommu_create_device_direct_mappings(struct 
iommu_group *group,
dma_addr_t start, end, addr;
size_t map_size = 0;
 
-   if (domain->ops->apply_resv_region)
-   domain->ops->apply_resv_region(dev, domain, entry);
-
start = ALIGN(entry->start, pg_size);
end   = ALIGN(entry->start + entry->length, pg_size);
 
-- 
2.25.1

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu