pseries/iommu: Restore_default_window does not use liobn parameter
[deliverable/linux.git] / arch / powerpc / platforms / pseries / iommu.c
index e2685badb5db1761c9621a486049361608f0742a..a8e99f9c3b41fa3462b431ac742f898aaac01f6f 100644 (file)
@@ -382,6 +382,7 @@ static int tce_clearrange_multi_pSeriesLP(unsigned long start_pfn,
                rc = plpar_tce_stuff((u64)be32_to_cpu(maprange->liobn),
                                             dma_offset,
                                             0, limit);
+               next += limit * tce_size;
                num_tce -= limit;
        } while (num_tce > 0 && !rc);
 
@@ -883,7 +884,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
 }
 
 static void restore_default_window(struct pci_dev *dev,
-                               u32 ddw_restore_token, unsigned long liobn)
+                                       u32 ddw_restore_token)
 {
        struct eeh_dev *edev;
        u32 cfg_addr;
@@ -1099,7 +1100,7 @@ out_free_prop:
 
 out_restore_window:
        if (ddw_restore_token)
-               restore_default_window(dev, ddw_restore_token, liobn);
+               restore_default_window(dev, ddw_restore_token);
 
 out_unlock:
        mutex_unlock(&direct_window_init_mutex);
@@ -1295,6 +1296,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
 
        switch (action) {
        case OF_RECONFIG_DETACH_NODE:
+               remove_ddw(np);
                if (pci && pci->iommu_table)
                        iommu_free_table(pci->iommu_table, np->full_name);
 
@@ -1307,16 +1309,6 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
                        }
                }
                spin_unlock(&direct_window_list_lock);
-
-               /*
-                * Because the notifier runs after isolation of the
-                * slot, we are guaranteed any DMA window has already
-                * been revoked and the TCEs have been marked invalid,
-                * so we don't need a call to remove_ddw(np). However,
-                * if an additional notifier action is added before the
-                * isolate call, we should update this code for
-                * completeness with such a call.
-                */
                break;
        default:
                err = NOTIFY_DONE;
This page took 0.026117 seconds and 5 git commands to generate.