Skip to contentSkip to conversation

ibm_newemac: Don't call dev_mc_add() before device is registered

PATCH Applied Benjamin Herrenschmidt 2 participants 2 messages Aug 17, 2008 – Aug 27, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibm_newemac: Don't call dev_mc_add() before device is registered

We must not call dev_mc_add() from within our HW configure which happens before we initialize and register the netdev. Do it in open() instead.

Thanks to Sebastian Siewior for tracking it down.

---

This fixes an uninitialized spinlock warning (and possibly more).

Please apply.

Cheers,
Ben.

drivers/net/ibm_newemac/core.c +3 -3
Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
@@ -663,9 +663,6 @@ static int emac_configure(struct emac_in
 	if (emac_phy_gpcs(dev->phy.mode))
 		emac_mii_reset_phy(&dev->phy);
 
-	/* Required for Pause packet support in EMAC */
-	dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1);
-
 	return 0;
 }
 
@@ -1150,6 +1147,9 @@ static int emac_open(struct net_device *
 	} else
 		netif_carrier_on(dev->ndev);
 
+	/* Required for Pause packet support in EMAC */
+	dev_mc_add(ndev, default_mcast_addr, sizeof(default_mcast_addr), 1);
+
 	emac_configure(dev);
 	mal_poll_add(dev->mal, &dev->commac);
 	mal_enable_tx_channel(dev->mal, dev->mal_tx_chan);

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Applied
#1 lore raw
Quoted 11 lines · Benjamin Herrenschmidt

We must not call dev_mc_add() from within our HW configure which happens before we initialize and register the netdev. Do it in open() instead.

Thanks to Sebastian Siewior for tracking it down.

---

This fixes an uninitialized spinlock warning (and possibly more).

Please apply.

applied