Skip to contentSkip to conversation

MIPS and PCI-related fixes

PATCH Applied Antony Pavlov 2 participants 4 messages Sep 12, 2018 – Sep 17, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover MIPS and PCI-related fixes

Antony Pavlov (2):
MIPS: fix PCI quirk infrastructure build
pci_of_match_device: don't crash on MIPS Malta

 arch/mips/lib/barebox.lds.S | 11 +++++++++++
 drivers/pci/pci.c           |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
Signature · 7 lines
2.18.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#1 lore raw

PATCH 1/2 MIPS: fix PCI quirk infrastructure build

The commit fc2c618c2038 ("pci: add quirk infrastructure") adds necessary ld-script changes only for ARM architecture. As a result, qemu-malta build fails:

     LD      barebox
    drivers/built-in.o: In function `pci_fixup_device':
    (.text.pci_fixup_device+0x30): undefined reference to `__end_pci_fixups_enable'
    (.text.pci_fixup_device+0x38): undefined reference to `__end_pci_fixups_enable'
    (.text.pci_fixup_device+0x34): undefined reference to `__start_pci_fixups_enable'
    (.text.pci_fixup_device+0x3c): undefined reference to `__start_pci_fixups_enable'
    (.text.pci_fixup_device+0x70): undefined reference to `__end_pci_fixups_header'
    (.text.pci_fixup_device+0x78): undefined reference to `__end_pci_fixups_header'
    (.text.pci_fixup_device+0x74): undefined reference to `__start_pci_fixups_header'
    (.text.pci_fixup_device+0x80): undefined reference to `__start_pci_fixups_header'
    (.text.pci_fixup_device+0x2c): undefined reference to `__end_pci_fixups_early'
    (.text.pci_fixup_device+0x88): undefined reference to `__end_pci_fixups_early'
    (.text.pci_fixup_device+0x84): undefined reference to `__start_pci_fixups_early'
    (.text.pci_fixup_device+0x90): undefined reference to `__start_pci_fixups_early'
    make: *** [Makefile:767: barebox] Error 1
---
 arch/mips/lib/barebox.lds.S | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/mips/lib/barebox.lds.S +11 -0
index 660d4be85e..c4026bb7f1 100644
@@ -75,6 +75,17 @@ SECTIONS
 	__usymtab : { BAREBOX_SYMS }
 	__usymtab_end = .;
 
+#ifdef CONFIG_PCI
+	__start_pci_fixups_early = .;
+	.pci_fixup_early : { KEEP(*(.pci_fixup_early)) }
+	__end_pci_fixups_early = .;
+	__start_pci_fixups_header = .;
+	.pci_fixup_header : { KEEP(*(.pci_fixup_header)) }
+	__end_pci_fixups_header = .;
+	__start_pci_fixups_enable = .;
+	.pci_fixup_enable : { KEEP(*(.pci_fixup_enable)) }
+	__end_pci_fixups_enable = .;
+#endif
 	.oftables : { BAREBOX_CLK_TABLE() }
 
 	.dtb : { BAREBOX_DTB() }
Signature · 7 lines
2.18.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
#2 lore raw

PATCH 2/2 pci_of_match_device: don't crash on MIPS Malta

In reply to Antony Pavlov

In arch/mips/mach-malta/pci.c PCI controller is instantiated without dt and struct pci_controller parent field is NULL.

---
 drivers/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pci.c +1 -1
index d206c53848..7abc7a3439 100644
@@ -339,7 +339,7 @@ pci_of_match_device(struct device_d *parent, unsigned int devfn)
 	struct device_node *np;
 	u32 reg;
 
-	if (!IS_ENABLED(CONFIG_OFTREE) || !parent->device_node)
+	if (!IS_ENABLED(CONFIG_OFTREE) || !parent || !parent->device_node)
 		return NULL;
 
 	for_each_child_of_node(parent->device_node, np) {
Signature · 7 lines
2.18.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#3 lore raw
In reply to Antony Pavlov
Quoted 7 lines · Antony Pavlov

Antony Pavlov (2):
MIPS: fix PCI quirk infrastructure build
pci_of_match_device: don't crash on MIPS Malta

 arch/mips/lib/barebox.lds.S | 11 +++++++++++
 drivers/pci/pci.c           |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

Quoted 5 lines
Signature · 2 lines
-- 
2.18.0
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox