kernel: generic: add kernel 4.3
[openwrt/openwrt.git] / target / linux / generic / patches-4.3 / 072-14-bgmac-reset-all-4-GMAC-cores-on-init.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Mon, 13 Apr 2015 15:56:26 +0200
3 Subject: [PATCH] bgmac: reset all 4 GMAC cores on init
4
5 On a BCM4709 based device, I found that GMAC cores may be enabled at
6 probe time, but only become usable after a full reset.
7 Disable cores before re-enabling them to ensure that they are properly
8 reset.
9
10 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
11 ---
12
13 --- a/drivers/net/ethernet/broadcom/bgmac.c
14 +++ b/drivers/net/ethernet/broadcom/bgmac.c
15 @@ -1641,8 +1641,11 @@ static int bgmac_probe(struct bcma_devic
16 ns_core = bcma_find_core_unit(core->bus,
17 BCMA_CORE_MAC_GBIT,
18 ns_gmac);
19 - if (ns_core && !bcma_core_is_enabled(ns_core))
20 - bcma_core_enable(ns_core, 0);
21 + if (!ns_core)
22 + continue;
23 +
24 + bcma_core_disable(ns_core, 0);
25 + bcma_core_enable(ns_core, 0);
26 }
27 }
28