netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5 net-next v2] tg3: Fix inconsistent locking for tg3_netif_start().
@ 2012-12-04  5:36 Michael Chan
  2012-12-04  5:36 ` [PATCH 2/5 net-next v2] tg3: PTP - Add header definitions, initialization and hw access functions Michael Chan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Michael Chan @ 2012-12-04  5:36 UTC (permalink / raw)
  To: davem; +Cc: netdev, nsujir, richardcochran

From: Nithin Nayak Sujir <nsujir@broadcom.com>

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>
---
 drivers/net/ethernet/broadcom/tg3.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 5cc976d..41a2dbd 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)
 	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
@@ -16598,8 +16599,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;
 	}
@@ -16610,6 +16611,8 @@ static void tg3_io_resume(struct pci_dev *pdev)
 
 	tg3_netif_start(tp);
 
+	tg3_full_unlock(tp);
+
 	tg3_phy_start(tp);
 
 done:
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-12-04 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04  5:36 [PATCH 1/5 net-next v2] tg3: Fix inconsistent locking for tg3_netif_start() Michael Chan
2012-12-04  5:36 ` [PATCH 2/5 net-next v2] tg3: PTP - Add header definitions, initialization and hw access functions Michael Chan
2012-12-04  5:36   ` [PATCH 3/5 net-next v2] tg3: PTP - Implement the ptp api and ethtool functions Michael Chan
2012-12-04  5:36     ` [PATCH 4/5 net-next v2] tg3: PTP - Add the hardware timestamp ioctl Michael Chan
2012-12-04  5:37       ` [PATCH 5/5 net-next v2] tg3: PTP - Enable the timestamping feature in hardware and fill skb tx/rx timestamps Michael Chan
2012-12-04  8:48 ` [PATCH 1/5 net-next v2] tg3: Fix inconsistent locking for tg3_netif_start() Richard Cochran
2012-12-04 18:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).