diff options
Diffstat (limited to 'arch/powerpc/kernel/pci-common.c')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 7fdf324d5b51..e58908066b0e 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -154,6 +154,42 @@ void pcibios_free_controller(struct pci_controller *phb) | |||
154 | EXPORT_SYMBOL_GPL(pcibios_free_controller); | 154 | EXPORT_SYMBOL_GPL(pcibios_free_controller); |
155 | 155 | ||
156 | /* | 156 | /* |
157 | * This function is used to call pcibios_free_controller() | ||
158 | * in a deferred manner: a callback from the PCI subsystem. | ||
159 | * | ||
160 | * _*DO NOT*_ call pcibios_free_controller() explicitly if | ||
161 | * this is used (or it may access an invalid *phb pointer). | ||
162 | * | ||
163 | * The callback occurs when all references to the root bus | ||
164 | * are dropped (e.g., child buses/devices and their users). | ||
165 | * | ||
166 | * It's called as .release_fn() of 'struct pci_host_bridge' | ||
167 | * which is associated with the 'struct pci_controller.bus' | ||
168 | * (root bus) - it expects .release_data to hold a pointer | ||
169 | * to 'struct pci_controller'. | ||
170 | * | ||
171 | * In order to use it, register .release_fn()/release_data | ||
172 | * like this: | ||
173 | * | ||
174 | * pci_set_host_bridge_release(bridge, | ||
175 | * pcibios_free_controller_deferred | ||
176 | * (void *) phb); | ||
177 | * | ||
178 | * e.g. in the pcibios_root_bridge_prepare() callback from | ||
179 | * pci_create_root_bus(). | ||
180 | */ | ||
181 | void pcibios_free_controller_deferred(struct pci_host_bridge *bridge) | ||
182 | { | ||
183 | struct pci_controller *phb = (struct pci_controller *) | ||
184 | bridge->release_data; | ||
185 | |||
186 | pr_debug("domain %d, dynamic %d\n", phb->global_number, phb->is_dynamic); | ||
187 | |||
188 | pcibios_free_controller(phb); | ||
189 | } | ||
190 | EXPORT_SYMBOL_GPL(pcibios_free_controller_deferred); | ||
191 | |||
192 | /* | ||
157 | * The function is used to return the minimal alignment | 193 | * The function is used to return the minimal alignment |
158 | * for memory or I/O windows of the associated P2P bridge. | 194 | * for memory or I/O windows of the associated P2P bridge. |
159 | * By default, 4KiB alignment for I/O windows and 1MiB for | 195 | * By default, 4KiB alignment for I/O windows and 1MiB for |