Revert "powerpc/pseries/iommu: Fix iommu initialisation during DLPAR add"
authorMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Feb 2024 00:00:41 +0000 (11:00 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 14 Feb 2024 03:24:00 +0000 (14:24 +1100)
This reverts commit ed8b94f6e0acd652ce69bd69d678a0c769172df8.

Gaurav reported that there are still problems with the patch and it
should be reverted pending a fuller fix.

Link: https://lore.kernel.org/all/4f6fc1ac-7a76-4447-9d0e-f55c0be373f8@linux.ibm.com/
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/ppc-pci.h
arch/powerpc/kernel/iommu.c
arch/powerpc/platforms/pseries/pci_dlpar.c

index c3a3f3df36d16dedf428b0d34ab87a480e80f510..ce2b1b5eebddcf5eb2e84b5e8853f89cf06501a6 100644 (file)
@@ -29,9 +29,6 @@ void *pci_traverse_device_nodes(struct device_node *start,
                                void *(*fn)(struct device_node *, void *),
                                void *data);
 extern void pci_devs_phb_init_dynamic(struct pci_controller *phb);
-extern void ppc_iommu_register_device(struct pci_controller *phb);
-extern void ppc_iommu_unregister_device(struct pci_controller *phb);
-
 
 /* From rtas_pci.h */
 extern void init_pci_config_tokens (void);
index c6f62e130d55c05ab7fe052cdc5d86f7c8eff964..ebe259bdd46298e0654fb681b0cf8853c8381079 100644 (file)
@@ -1388,21 +1388,6 @@ static const struct attribute_group *spapr_tce_iommu_groups[] = {
        NULL,
 };
 
-void ppc_iommu_register_device(struct pci_controller *phb)
-{
-       iommu_device_sysfs_add(&phb->iommu, phb->parent,
-                               spapr_tce_iommu_groups, "iommu-phb%04x",
-                               phb->global_number);
-       iommu_device_register(&phb->iommu, &spapr_tce_iommu_ops,
-                               phb->parent);
-}
-
-void ppc_iommu_unregister_device(struct pci_controller *phb)
-{
-       iommu_device_unregister(&phb->iommu);
-       iommu_device_sysfs_remove(&phb->iommu);
-}
-
 /*
  * This registers IOMMU devices of PHBs. This needs to happen
  * after core_initcall(iommu_init) + postcore_initcall(pci_driver_init) and
@@ -1413,7 +1398,11 @@ static int __init spapr_tce_setup_phb_iommus_initcall(void)
        struct pci_controller *hose;
 
        list_for_each_entry(hose, &hose_list, list_node) {
-               ppc_iommu_register_device(hose);
+               iommu_device_sysfs_add(&hose->iommu, hose->parent,
+                                      spapr_tce_iommu_groups, "iommu-phb%04x",
+                                      hose->global_number);
+               iommu_device_register(&hose->iommu, &spapr_tce_iommu_ops,
+                                     hose->parent);
        }
        return 0;
 }
index 4448386268d99155657fe6179ad8fd0132676f13..4ba8245681192120860ad1278a1b7ec7110a4bfc 100644 (file)
@@ -35,8 +35,6 @@ struct pci_controller *init_phb_dynamic(struct device_node *dn)
 
        pseries_msi_allocate_domains(phb);
 
-       ppc_iommu_register_device(phb);
-
        /* Create EEH devices for the PHB */
        eeh_phb_pe_create(phb);
 
@@ -78,8 +76,6 @@ int remove_phb_dynamic(struct pci_controller *phb)
                }
        }
 
-       ppc_iommu_unregister_device(phb);
-
        pseries_msi_free_domains(phb);
 
        /* Keep a reference so phb isn't freed yet */