Skip to contentSkip to conversation

arm: mvebu: fix coherency_late_init() for multiplatform

PATCH New Thomas Petazzoni 3 participants 3 messages Jun 20, 2013

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

PATCH 1/1 arm: mvebu: fix coherency_late_init() for multiplatform

As noticed by Arnaud Patard (Rtp) <[email protected]>, commit 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code') added a postcore_initcall() to register the bus notifier that the mvebu code needs to apply correct DMA operations on its platform devices breaks the multiplatform boot on other platforms, because the bus notifier registration is unconditional.

This commit fixes that by registering the bus notifier only if we have the mvebu coherency unit described in the Device Tree. The conditional used is exactly the same in which the bus_register_notifier() call was originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code').

---
This fix has been reported by Arnaud to fix the boot on his OMAP4 PandaBoard, and it continues to work well on Marvell Armada XP GP.

This commit is based on jcooper/mvebu/regmap.

---
 arch/arm/mach-mvebu/coherency.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/coherency.c +3 -2
index 32fcf69..be11759 100644
@@ -147,8 +147,9 @@ int __init coherency_init(void)
 
 static int __init coherency_late_init(void)
 {
-	bus_register_notifier(&platform_bus_type,
-			      &mvebu_hwcc_platform_nb);
+	if (of_find_matching_node(NULL, of_coherency_table))
+		bus_register_notifier(&platform_bus_type,
+				      &mvebu_hwcc_platform_nb);
 	return 0;
 }
 
Signature · 1 line
1.8.1.2
maintainer
#1 lore raw

PATCH 1/1 arm: mvebu: fix coherency_late_init() for multiplatform

Quoted 43 lines · Thomas Petazzoni

As noticed by Arnaud Patard (Rtp) <[email protected]>, commit 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code') added a postcore_initcall() to register the bus notifier that the mvebu code needs to apply correct DMA operations on its platform devices breaks the multiplatform boot on other platforms, because the bus notifier registration is unconditional.

This commit fixes that by registering the bus notifier only if we have the mvebu coherency unit described in the Device Tree. The conditional used is exactly the same in which the bus_register_notifier() call was originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code').

---
This fix has been reported by Arnaud to fix the boot on his OMAP4 PandaBoard, and it continues to work well on Marvell Armada XP GP.

This commit is based on jcooper/mvebu/regmap.

---
 arch/arm/mach-mvebu/coherency.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-mvebu/coherency.c +3 -2
index 32fcf69..be11759 100644
@@ -147,8 +147,9 @@ int __init coherency_init(void)
 
 static int __init coherency_late_init(void)
 {
-	bus_register_notifier(&platform_bus_type,
-			      &mvebu_hwcc_platform_nb);
+	if (of_find_matching_node(NULL, of_coherency_table))
+		bus_register_notifier(&platform_bus_type,
+				      &mvebu_hwcc_platform_nb);
 	return 0;
 }
 
Signature · 1 line
1.8.1.2

Andrew

Applied
#2 lore raw

PATCH 1/1 arm: mvebu: fix coherency_late_init() for multiplatform

In reply to Thomas Petazzoni
Quoted 15 lines · Thomas Petazzoni

As noticed by Arnaud Patard (Rtp) <[email protected]>, commit 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code') added a postcore_initcall() to register the bus notifier that the mvebu code needs to apply correct DMA operations on its platform devices breaks the multiplatform boot on other platforms, because the bus notifier registration is unconditional.

This commit fixes that by registering the bus notifier only if we have the mvebu coherency unit described in the Device Tree. The conditional used is exactly the same in which the bus_register_notifier() call was originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in coherency code').

Quoted 8 lines

---
This fix has been reported by Arnaud to fix the boot on his OMAP4 PandaBoard, and it continues to work well on Marvell Armada XP GP.

This commit is based on jcooper/mvebu/regmap.

---
 arch/arm/mach-mvebu/coherency.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Applied to mvebu/regmap

thx,

Jason.