67cf7d3a6153d86eebb432f6b9c63e27c2d6bbfc
[openwrt/staging/chunkeey.git] / target / linux / lantiq / patches-4.9 / 0070-MIPS-Lantiq-Keep-ethernet-enabled-during-boot.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Thu, 19 Jan 2017 14:14:36 +0100
3 Subject: [PATCH] MIPS: Lantiq: Keep ethernet enabled during boot
4
5 Disabling ethernet during reboot (only to enable it again when the
6 ethernet driver attaches) can put the chip into a faulty state where it
7 corrupts the header of all incoming packets.
8
9 This happens if packets arrive during the time window where the core is
10 disabled, and it can be easily reproduced by rebooting while sending a
11 flood ping to the broadcast address.
12
13 Cc: john@phrozen.org
14 Cc: hauke.mehrtens@lantiq.com
15 Cc: stable@vger.kernel.org
16 Fixes: 95135bfa7ead ("MIPS: Lantiq: Deactivate most of the devices by default")
17 Signed-off-by: Felix Fietkau <nbd@nbd.name>
18 ---
19
20 --- a/arch/mips/lantiq/xway/sysctrl.c
21 +++ b/arch/mips/lantiq/xway/sysctrl.c
22 @@ -564,7 +564,7 @@ void __init ltq_soc_init(void)
23 clkdev_add_pmu("1a800000.pcie", "msi", 1, 1, PMU1_PCIE2_MSI);
24 clkdev_add_pmu("1a800000.pcie", "pdi", 1, 1, PMU1_PCIE2_PDI);
25 clkdev_add_pmu("1a800000.pcie", "ctl", 1, 1, PMU1_PCIE2_CTL);
26 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH | PMU_PPE_DP);
27 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH | PMU_PPE_DP);
28 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
29 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
30 } else if (of_machine_is_compatible("lantiq,ar10")) {
31 @@ -572,7 +572,7 @@ void __init ltq_soc_init(void)
32 ltq_ar10_fpi_hz(), ltq_ar10_pp32_hz());
33 clkdev_add_pmu("1e101000.usb", "ctl", 1, 0, PMU_USB0);
34 clkdev_add_pmu("1e106000.usb", "ctl", 1, 0, PMU_USB1);
35 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0, PMU_SWITCH |
36 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0, PMU_SWITCH |
37 PMU_PPE_DP | PMU_PPE_TC);
38 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
39 clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY);
40 @@ -594,11 +594,11 @@ void __init ltq_soc_init(void)
41 clkdev_add_pmu(NULL, "ahb", 1, 0, PMU_AHBM | PMU_AHBS);
42
43 clkdev_add_pmu("1da00000.usif", "NULL", 1, 0, PMU_USIF);
44 - clkdev_add_pmu("1e108000.eth", NULL, 1, 0,
45 + clkdev_add_pmu("1e108000.eth", NULL, 0, 0,
46 PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM |
47 PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 |
48 PMU_PPE_QSB | PMU_PPE_TOP);
49 - clkdev_add_pmu("1f203000.rcu", "gphy", 1, 0, PMU_GPHY);
50 + clkdev_add_pmu("1f203000.rcu", "gphy", 0, 0, PMU_GPHY);
51 clkdev_add_pmu("1e103000.sdio", NULL, 1, 0, PMU_SDIO);
52 clkdev_add_pmu("1e103100.deu", NULL, 1, 0, PMU_DEU);
53 clkdev_add_pmu("1e116000.mei", "dfe", 1, 0, PMU_DFE);