[for-3.18,3/5] bgmac: reset & enable Ethernet core before using it

Message ID 1499168664-25980-4-git-send-email-amit.pundir@linaro.org
State New
Headers show
Series
  • Stable commits picked up from lede project
Related show

Commit Message

Amit Pundir July 4, 2017, 11:44 a.m.
From: Rafał Miłecki <zajec5@gmail.com>


commit b4dfd8e92956b396d3438212bc9a0be6267b8b34 upstream.

This fixes Ethernet on D-Link DIR-885L with BCM47094 SoC. Felix reported
similar fix was needed for his BCM4709 device (Buffalo WXR-1900DHP?).
I tested this for regressions on BCM4706, BCM4708A0 and BCM47081A0.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

---
To be cherry-picked on linux-4.4.y as well.

 drivers/net/ethernet/broadcom/bgmac.c | 5 +++++
 1 file changed, 5 insertions(+)

-- 
2.7.4

Patch

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 54a7da860a2d..2b58df0c4f48 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -1438,6 +1438,11 @@  static int bgmac_probe(struct bcma_device *core)
 		dev_warn(&core->dev, "Using random MAC: %pM\n", mac);
 	}
 
+	/* This (reset &) enable is not preset in specs or reference driver but
+	 * Broadcom does it in arch PCI code when enabling fake PCI device.
+	 */
+	bcma_core_enable(core, 0);
+
 	/* Allocation and references */
 	net_dev = alloc_etherdev(sizeof(*bgmac));
 	if (!net_dev)