Commit c3a8a805 authored by David Brownell's avatar David Brownell Committed by Kevin Hilman

davinci_emac locking bugfix

Do spinlock initialization during davinci_emac::probe(), when
the lock is allocated, not each time it's opened.  That's the
correct place to do such work.

More significantly, fix a bug: one of the three spinlocks was
never getting initialized, preventing the system from booting
in some cases (e.g. running with lockdep).
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 29d7a8f9
......@@ -2402,9 +2402,6 @@ static int emac_dev_open(struct net_device *ndev)
for (cnt = 0; cnt <= ETH_ALEN; cnt++)
ndev->dev_addr[cnt] = priv->mac_addr[cnt];
spin_lock_init(&priv->tx_lock);
spin_lock_init(&priv->rx_lock);
/* Configuration items */
priv->rx_buf_size = EMAC_DEF_MAX_FRAME_SIZE + EMAC_DEF_EXTRA_RXBUF_SIZE;
......@@ -2631,6 +2628,10 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
priv->ndev = ndev;
priv->msg_enable = netif_msg_init(debug_level, DAVINCI_EMAC_DEBUG);
spin_lock_init(&priv->tx_lock);
spin_lock_init(&priv->rx_lock);
spin_lock_init(&priv->lock);
/* MAC addr: from platform_data */
if (pdev->dev.platform_data) {
struct emac_platform_data *pdata = pdev->dev.platform_data;
......
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