Commit e7731194 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by David S. Miller

net: bgmac: postpone turning IRQs off to avoid SoC hangs

Turning IRQs off is done by accessing Ethernet controller registers.
That can't be done until device's clock is enabled. It results in a SoC
hang otherwise.

This bug remained unnoticed for years as most bootloaders keep all
Ethernet interfaces turned on. It seems to only affect a niche SoC
family BCM47189. It has two Ethernet controllers but CFE bootloader uses
only the first one.

Fixes: 34322615 ("net: bgmac: Mask interrupts during probe")
Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
Reviewed-by: default avatarMichal Kubiak <michal.kubiak@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8139dccd
...@@ -1492,8 +1492,6 @@ int bgmac_enet_probe(struct bgmac *bgmac) ...@@ -1492,8 +1492,6 @@ int bgmac_enet_probe(struct bgmac *bgmac)
bgmac->in_init = true; bgmac->in_init = true;
bgmac_chip_intrs_off(bgmac);
net_dev->irq = bgmac->irq; net_dev->irq = bgmac->irq;
SET_NETDEV_DEV(net_dev, bgmac->dev); SET_NETDEV_DEV(net_dev, bgmac->dev);
dev_set_drvdata(bgmac->dev, bgmac); dev_set_drvdata(bgmac->dev, bgmac);
...@@ -1511,6 +1509,8 @@ int bgmac_enet_probe(struct bgmac *bgmac) ...@@ -1511,6 +1509,8 @@ int bgmac_enet_probe(struct bgmac *bgmac)
*/ */
bgmac_clk_enable(bgmac, 0); bgmac_clk_enable(bgmac, 0);
bgmac_chip_intrs_off(bgmac);
/* This seems to be fixing IRQ by assigning OOB #6 to the core */ /* This seems to be fixing IRQ by assigning OOB #6 to the core */
if (!(bgmac->feature_flags & BGMAC_FEAT_IDM_MASK)) { if (!(bgmac->feature_flags & BGMAC_FEAT_IDM_MASK)) {
if (bgmac->feature_flags & BGMAC_FEAT_IRQ_ID_OOB_6) if (bgmac->feature_flags & BGMAC_FEAT_IRQ_ID_OOB_6)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment