Skip to content

Commit

Permalink
tg3: Fix inconsistent locking for tg3_netif_start().
Browse files Browse the repository at this point in the history
Every caller holds tp->lock when calling tg3_netif_start() except
tg3_io_resume().  Fix it so that it is all consistent.  The subsequent
PTP patches add tg3_ptp_resume() to tg3_netif_start() and the tp->lock
is required.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nithin Nayak Sujir authored and David S. Miller committed Dec 4, 2012
1 parent 682d797 commit 3576306
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -6525,6 +6525,7 @@ static inline void tg3_netif_stop(struct tg3 *tp)
netif_tx_disable(tp->dev);
}

/* tp->lock must be held */
static inline void tg3_netif_start(struct tg3 *tp)
{
/* NOTE: unconditional netif_tx_wake_all_queues is only
Expand Down Expand Up @@ -16599,8 +16600,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
tg3_full_lock(tp, 0);
tg3_flag_set(tp, INIT_COMPLETE);
err = tg3_restart_hw(tp, 1);
tg3_full_unlock(tp);
if (err) {
tg3_full_unlock(tp);
netdev_err(netdev, "Cannot restart hardware after reset.\n");
goto done;
}
Expand All @@ -16611,6 +16612,8 @@ static void tg3_io_resume(struct pci_dev *pdev)

tg3_netif_start(tp);

tg3_full_unlock(tp);

tg3_phy_start(tp);

done:
Expand Down

0 comments on commit 3576306

Please sign in to comment.