.. | .. |
---|
133 | 133 | return 0; |
---|
134 | 134 | } |
---|
135 | 135 | |
---|
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 = { |
---|
137 | 142 | .notifier_call = fail_iommu_bus_notify |
---|
138 | 143 | }; |
---|
| 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 |
---|
139 | 150 | |
---|
140 | 151 | static int __init fail_iommu_setup(void) |
---|
141 | 152 | { |
---|
142 | 153 | #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); |
---|
144 | 155 | #endif |
---|
145 | 156 | #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); |
---|
147 | 158 | #endif |
---|
148 | 159 | |
---|
149 | 160 | return 0; |
---|