hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/arch/powerpc/kernel/pci_32.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Common pmac/prep/chrp pci routines. -- Cort
34 */
....@@ -10,14 +11,13 @@
1011 #include <linux/capability.h>
1112 #include <linux/sched.h>
1213 #include <linux/errno.h>
13
-#include <linux/bootmem.h>
14
+#include <linux/memblock.h>
1415 #include <linux/syscalls.h>
1516 #include <linux/irq.h>
1617 #include <linux/list.h>
1718 #include <linux/of.h>
1819 #include <linux/slab.h>
1920 #include <linux/export.h>
20
-#include <linux/syscalls.h>
2121
2222 #include <asm/processor.h>
2323 #include <asm/io.h>
....@@ -204,7 +204,11 @@
204204 struct property* of_prop;
205205 struct device_node *dn;
206206
207
- of_prop = memblock_virt_alloc(sizeof(struct property) + 256, 0);
207
+ of_prop = memblock_alloc(sizeof(struct property) + 256,
208
+ SMP_CACHE_BYTES);
209
+ if (!of_prop)
210
+ panic("%s: Failed to allocate %zu bytes\n", __func__,
211
+ sizeof(struct property) + 256);
208212 dn = of_find_node_by_path("/");
209213 if (dn) {
210214 memset(of_prop, -1, sizeof(struct property) + 256);
....@@ -259,6 +263,10 @@
259263 /* Call common code to handle resource allocation */
260264 pcibios_resource_survey();
261265
266
+ /* Call machine dependent fixup */
267
+ if (ppc_md.pcibios_fixup)
268
+ ppc_md.pcibios_fixup();
269
+
262270 /* Call machine dependent post-init code */
263271 if (ppc_md.pcibios_after_init)
264272 ppc_md.pcibios_after_init();