base-files: define yes/no as valid boolean options
[openwrt.git] / target / linux / mvebu / patches-3.10 / 0033-arm-mvebu-fix-coherency_late_init-for-multiplatform.patch
1 From 3891658a01af7e875d4c176ebb5d713d74a6e998 Mon Sep 17 00:00:00 2001
2 From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
3 Date: Thu, 20 Jun 2013 09:45:26 +0200
4 Subject: [PATCH 033/203] arm: mvebu: fix coherency_late_init() for
5  multiplatform
6
7 As noticed by Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>, commit
8 865e0527d2d7 ('arm: mvebu: avoid hardcoded virtual address in
9 coherency code') added a postcore_initcall() to register the bus
10 notifier that the mvebu code needs to apply correct DMA operations on
11 its platform devices breaks the multiplatform boot on other platforms,
12 because the bus notifier registration is unconditional.
13
14 This commit fixes that by registering the bus notifier only if we have
15 the mvebu coherency unit described in the Device Tree. The conditional
16 used is exactly the same in which the bus_register_notifier() call was
17 originally enclosed before 865e0527d2d7 ('arm: mvebu: avoid hardcoded
18 virtual address in coherency code').
19
20 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
21 Reported-by: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
22 Acked-by: Andrew Lunn <andrew@lunn.ch>
23 Signed-off-by: Jason Cooper <jason@lakedaemon.net>
24 ---
25  arch/arm/mach-mvebu/coherency.c | 5 +++--
26  1 file changed, 3 insertions(+), 2 deletions(-)
27
28 --- a/arch/arm/mach-mvebu/coherency.c
29 +++ b/arch/arm/mach-mvebu/coherency.c
30 @@ -147,8 +147,9 @@ int __init coherency_init(void)
31  
32  static int __init coherency_late_init(void)
33  {
34 -       bus_register_notifier(&platform_bus_type,
35 -                             &mvebu_hwcc_platform_nb);
36 +       if (of_find_matching_node(NULL, of_coherency_table))
37 +               bus_register_notifier(&platform_bus_type,
38 +                                     &mvebu_hwcc_platform_nb);
39         return 0;
40  }
41