hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/kernel/iommu.c
....@@ -133,17 +133,28 @@
133133 return 0;
134134 }
135135
136
-static struct notifier_block fail_iommu_bus_notifier = {
136
+/*
137
+ * PCI and VIO buses need separate notifier_block structs, since they're linked
138
+ * list nodes. Sharing a notifier_block would mean that any notifiers later
139
+ * registered for PCI buses would also get called by VIO buses and vice versa.
140
+ */
141
+static struct notifier_block fail_iommu_pci_bus_notifier = {
137142 .notifier_call = fail_iommu_bus_notify
138143 };
144
+
145
+#ifdef CONFIG_IBMVIO
146
+static struct notifier_block fail_iommu_vio_bus_notifier = {
147
+ .notifier_call = fail_iommu_bus_notify
148
+};
149
+#endif
139150
140151 static int __init fail_iommu_setup(void)
141152 {
142153 #ifdef CONFIG_PCI
143
- bus_register_notifier(&pci_bus_type, &fail_iommu_bus_notifier);
154
+ bus_register_notifier(&pci_bus_type, &fail_iommu_pci_bus_notifier);
144155 #endif
145156 #ifdef CONFIG_IBMVIO
146
- bus_register_notifier(&vio_bus_type, &fail_iommu_bus_notifier);
157
+ bus_register_notifier(&vio_bus_type, &fail_iommu_vio_bus_notifier);
147158 #endif
148159
149160 return 0;