mwlwifi: upgrade to 10.3.0.17-20160324
[openwrt.git] / target / linux / bcm53xx / patches-4.4 / 301-Revert-ARM-BCM5301X-remove-workaround-imprecise-abor.patch
1 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
2 Date: Tue, 8 Mar 2016 09:03:21 +0100
3 Subject: [PATCH] Revert "ARM: BCM5301X: remove workaround imprecise abort
4  fault handler"
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 This reverts commit 937b12306ea79044c86f2e69b3061c7279245825.
10
11 It seems imprecise external abort (0x1406) can be still happen on
12 BCM4709 during PCI initialization.
13
14 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
15 ---
16
17 --- a/arch/arm/mach-bcm/bcm_5301x.c
18 +++ b/arch/arm/mach-bcm/bcm_5301x.c
19 @@ -9,6 +9,40 @@
20  #include <asm/hardware/cache-l2x0.h>
21  
22  #include <asm/mach/arch.h>
23 +#include <asm/siginfo.h>
24 +#include <asm/signal.h>
25 +
26 +
27 +static bool first_fault = true;
28 +
29 +static int bcm5301x_abort_handler(unsigned long addr, unsigned int fsr,
30 +                                struct pt_regs *regs)
31 +{
32 +       if ((fsr == 0x1406 || fsr == 0x1c06) && first_fault) {
33 +               first_fault = false;
34 +
35 +               /*
36 +                * These faults with codes 0x1406 (BCM4709) or 0x1c06 happens
37 +                * for no good reason, possibly left over from the CFE boot
38 +                * loader.
39 +                */
40 +               pr_warn("External imprecise Data abort at addr=%#lx, fsr=%#x ignored.\n",
41 +                       addr, fsr);
42 +
43 +               /* Returning non-zero causes fault display and panic */
44 +               return 0;
45 +       }
46 +
47 +       /* Others should cause a fault */
48 +       return 1;
49 +}
50 +
51 +static void __init bcm5301x_init_early(void)
52 +{
53 +       /* Install our hook */
54 +       hook_fault_code(16 + 6, bcm5301x_abort_handler, SIGBUS, BUS_OBJERR,
55 +                       "imprecise external abort");
56 +}
57  
58  static const char *const bcm5301x_dt_compat[] __initconst = {
59         "brcm,bcm4708",
60 @@ -18,5 +52,6 @@ static const char *const bcm5301x_dt_com
61  DT_MACHINE_START(BCM5301X, "BCM5301X")
62         .l2c_aux_val    = 0,
63         .l2c_aux_mask   = ~0,
64 +       .init_early     = bcm5301x_init_early,
65         .dt_compat      = bcm5301x_dt_compat,
66  MACHINE_END