aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom
diff options
context:
space:
mode:
authorNithin Nayak Sujir <nsujir@broadcom.com>2012-12-03 14:36:56 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-04 12:58:49 -0500
commit357630668a638418d542d0e331c90c01a091a3f1 (patch)
treee87eea7fa63da9b38dfaf9eeab558e52a5cc0c4c /drivers/net/ethernet/broadcom
parent682d7978aee072f411fc747d32954a8371dd7b1b (diff)
tg3: Fix inconsistent locking for tg3_netif_start().
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>
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index ac94939c03e6..a4a5e2d329e4 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6525,6 +6525,7 @@ static inline void tg3_netif_stop(struct tg3 *tp)
6525 netif_tx_disable(tp->dev); 6525 netif_tx_disable(tp->dev);
6526} 6526}
6527 6527
6528/* tp->lock must be held */
6528static inline void tg3_netif_start(struct tg3 *tp) 6529static inline void tg3_netif_start(struct tg3 *tp)
6529{ 6530{
6530 /* NOTE: unconditional netif_tx_wake_all_queues is only 6531 /* NOTE: unconditional netif_tx_wake_all_queues is only
@@ -16599,8 +16600,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
16599 tg3_full_lock(tp, 0); 16600 tg3_full_lock(tp, 0);
16600 tg3_flag_set(tp, INIT_COMPLETE); 16601 tg3_flag_set(tp, INIT_COMPLETE);
16601 err = tg3_restart_hw(tp, 1); 16602 err = tg3_restart_hw(tp, 1);
16602 tg3_full_unlock(tp);
16603 if (err) { 16603 if (err) {
16604 tg3_full_unlock(tp);
16604 netdev_err(netdev, "Cannot restart hardware after reset.\n"); 16605 netdev_err(netdev, "Cannot restart hardware after reset.\n");
16605 goto done; 16606 goto done;
16606 } 16607 }
@@ -16611,6 +16612,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
16611 16612
16612 tg3_netif_start(tp); 16613 tg3_netif_start(tp);
16613 16614
16615 tg3_full_unlock(tp);
16616
16614 tg3_phy_start(tp); 16617 tg3_phy_start(tp);
16615 16618
16616done: 16619done: