2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 18:23:53 +08:00

arm: mvebu: fix coherency_late_init() for multiplatform

As noticed by Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>, commit
865e0527d2 ('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 865e0527d2 ('arm: mvebu: avoid hardcoded
virtual address in coherency code').

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
This commit is contained in:
Thomas Petazzoni 2013-06-20 09:45:26 +02:00 committed by Jason Cooper
parent 5fb2038d61
commit 1919bff0e2

View File

@ -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;
}