Skip to content

Commit

Permalink
net: bgmac: postpone turning IRQs off to avoid SoC hangs
Browse files Browse the repository at this point in the history
BugLink: https://bugs.launchpad.net/bugs/2036075

[ Upstream commit e773119 ]

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: 3432261 ("net: bgmac: Mask interrupts during probe")
Signed-off-by: Rafał Miłecki <[email protected]>
Reviewed-by: Michal Kubiak <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Kamal Mostafa <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
  • Loading branch information
Rafał Miłecki authored and roxanan1996 committed Oct 2, 2023
1 parent 0a4562f commit 69f43e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/bgmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1492,8 +1492,6 @@ int bgmac_enet_probe(struct bgmac *bgmac)

bgmac->in_init = true;

bgmac_chip_intrs_off(bgmac);

net_dev->irq = bgmac->irq;
SET_NETDEV_DEV(net_dev, bgmac->dev);
dev_set_drvdata(bgmac->dev, bgmac);
Expand All @@ -1511,6 +1509,8 @@ int bgmac_enet_probe(struct bgmac *bgmac)
*/
bgmac_clk_enable(bgmac, 0);

bgmac_chip_intrs_off(bgmac);

/* 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_IRQ_ID_OOB_6)
Expand Down

0 comments on commit 69f43e8

Please sign in to comment.