iommu: remove the unused domain_window_disable method
authorChristoph Hellwig <hch@lst.de>
Thu, 1 Apr 2021 15:52:37 +0000 (17:52 +0200)
committerJoerg Roedel <jroedel@suse.de>
Wed, 7 Apr 2021 08:56:51 +0000 (10:56 +0200)
domain_window_disable is wired up by fsl_pamu, but never actually called.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Li Yang <leoyang.li@nxp.com>
Link: https://lore.kernel.org/r/20210401155256.298656-2-hch@lst.de
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/fsl_pamu_domain.c
include/linux/iommu.h

index b211076..53380cf 100644 (file)
@@ -473,53 +473,6 @@ static int update_domain_mapping(struct fsl_dma_domain *dma_domain, u32 wnd_nr)
        return ret;
 }
 
-static int disable_domain_win(struct fsl_dma_domain *dma_domain, u32 wnd_nr)
-{
-       struct device_domain_info *info;
-       int ret = 0;
-
-       list_for_each_entry(info, &dma_domain->devices, link) {
-               if (dma_domain->win_cnt == 1 && dma_domain->enabled) {
-                       ret = pamu_disable_liodn(info->liodn);
-                       if (!ret)
-                               dma_domain->enabled = 0;
-               } else {
-                       ret = pamu_disable_spaace(info->liodn, wnd_nr);
-               }
-       }
-
-       return ret;
-}
-
-static void fsl_pamu_window_disable(struct iommu_domain *domain, u32 wnd_nr)
-{
-       struct fsl_dma_domain *dma_domain = to_fsl_dma_domain(domain);
-       unsigned long flags;
-       int ret;
-
-       spin_lock_irqsave(&dma_domain->domain_lock, flags);
-       if (!dma_domain->win_arr) {
-               pr_debug("Number of windows not configured\n");
-               spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
-               return;
-       }
-
-       if (wnd_nr >= dma_domain->win_cnt) {
-               pr_debug("Invalid window index\n");
-               spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
-               return;
-       }
-
-       if (dma_domain->win_arr[wnd_nr].valid) {
-               ret = disable_domain_win(dma_domain, wnd_nr);
-               if (!ret) {
-                       dma_domain->win_arr[wnd_nr].valid = 0;
-                       dma_domain->mapped--;
-               }
-       }
-
-       spin_unlock_irqrestore(&dma_domain->domain_lock, flags);
-}
 
 static int fsl_pamu_window_enable(struct iommu_domain *domain, u32 wnd_nr,
                                  phys_addr_t paddr, u64 size, int prot)
@@ -1032,7 +985,6 @@ static const struct iommu_ops fsl_pamu_ops = {
        .attach_dev     = fsl_pamu_attach_device,
        .detach_dev     = fsl_pamu_detach_device,
        .domain_window_enable = fsl_pamu_window_enable,
-       .domain_window_disable = fsl_pamu_window_disable,
        .iova_to_phys   = fsl_pamu_iova_to_phys,
        .domain_set_attr = fsl_pamu_set_domain_attr,
        .domain_get_attr = fsl_pamu_get_domain_attr,
index 86d688c..565b881 100644 (file)
@@ -223,7 +223,6 @@ struct iommu_iotlb_gather {
  * @put_resv_regions: Free list of reserved regions for a device
  * @apply_resv_region: Temporary helper call-back for iova reserved ranges
  * @domain_window_enable: Configure and enable a particular window for a domain
- * @domain_window_disable: Disable a particular window for a domain
  * @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)
@@ -284,7 +283,6 @@ struct iommu_ops {
        /* Window handling functions */
        int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr,
                                    phys_addr_t paddr, u64 size, int prot);
-       void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr);
 
        int (*of_xlate)(struct device *dev, struct of_phandle_args *args);
        bool (*is_attach_deferred)(struct iommu_domain *domain, struct device *dev);