All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug
@ 2013-05-21 22:57 Nithin Nayak Sujir
  2013-05-21 22:57 ` [PATCH net-next 1/2] tg3: Ensure boot code has completed initialization before accessing hardware Nithin Nayak Sujir
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nithin Nayak Sujir @ 2013-05-21 22:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nithin Nayak Sujir

This patch fixes an issue that was recently observed on one platform after few
hundred suspend/resume loops. The code has existed since day one and affects
every tg3 device. Due to the scope of the devices affected, submitting this
patch to net-next to let it bake for sometime before submitting to stable.

Nithin Nayak Sujir (2):
  tg3: Ensure boot code has completed initialization before accessing
    hardware
  tg3: Update version to 3.132

 drivers/net/ethernet/broadcom/tg3.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
1.8.1.4

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

* [PATCH net-next 1/2] tg3: Ensure boot code has completed initialization before accessing hardware
  2013-05-21 22:57 [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug Nithin Nayak Sujir
@ 2013-05-21 22:57 ` Nithin Nayak Sujir
  2013-05-21 22:57 ` [PATCH net-next 2/2] tg3: Update version to 3.132 Nithin Nayak Sujir
  2013-05-22 21:51 ` [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Nithin Nayak Sujir @ 2013-05-21 22:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nithin Nayak Sujir, Michael Chan

After resetting the device, the driver waits for a signature to be
updated to know that firmware has completed initialization. However, the
call to tg3_poll_fw() is being done too late and we're writing to the
GRC_MODE register before it has completely initialized, causing
contention with firmware.  This logic has existed since day one but is
causing PCIE link to go down randomly at startup on one platform once
every few hundred reboots.

Move the tg3_poll_fw() up to before we write to the GRC_MODE register
after reset.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index fb06aa1..6ba031b 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8956,6 +8956,10 @@ static int tg3_chip_reset(struct tg3 *tp)
 		tg3_halt_cpu(tp, RX_CPU_BASE);
 	}
 
+	err = tg3_poll_fw(tp);
+	if (err)
+		return err;
+
 	tw32(GRC_MODE, tp->grc_mode);
 
 	if (tg3_chip_rev_id(tp) == CHIPREV_ID_5705_A0) {
@@ -8986,10 +8990,6 @@ static int tg3_chip_reset(struct tg3 *tp)
 
 	tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
 
-	err = tg3_poll_fw(tp);
-	if (err)
-		return err;
-
 	tg3_mdio_start(tp);
 
 	if (tg3_flag(tp, PCI_EXPRESS) &&
-- 
1.8.1.4

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

* [PATCH net-next 2/2] tg3: Update version to 3.132
  2013-05-21 22:57 [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug Nithin Nayak Sujir
  2013-05-21 22:57 ` [PATCH net-next 1/2] tg3: Ensure boot code has completed initialization before accessing hardware Nithin Nayak Sujir
@ 2013-05-21 22:57 ` Nithin Nayak Sujir
  2013-05-22 21:51 ` [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Nithin Nayak Sujir @ 2013-05-21 22:57 UTC (permalink / raw)
  To: davem; +Cc: netdev, Nithin Nayak Sujir

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
---
 drivers/net/ethernet/broadcom/tg3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 6ba031b..2302a44 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -94,10 +94,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits)
 
 #define DRV_MODULE_NAME		"tg3"
 #define TG3_MAJ_NUM			3
-#define TG3_MIN_NUM			131
+#define TG3_MIN_NUM			132
 #define DRV_MODULE_VERSION	\
 	__stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
-#define DRV_MODULE_RELDATE	"April 09, 2013"
+#define DRV_MODULE_RELDATE	"May 21, 2013"
 
 #define RESET_KIND_SHUTDOWN	0
 #define RESET_KIND_INIT		1
-- 
1.8.1.4

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

* Re: [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug
  2013-05-21 22:57 [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug Nithin Nayak Sujir
  2013-05-21 22:57 ` [PATCH net-next 1/2] tg3: Ensure boot code has completed initialization before accessing hardware Nithin Nayak Sujir
  2013-05-21 22:57 ` [PATCH net-next 2/2] tg3: Update version to 3.132 Nithin Nayak Sujir
@ 2013-05-22 21:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-05-22 21:51 UTC (permalink / raw)
  To: nsujir; +Cc: netdev

From: "Nithin Nayak Sujir" <nsujir@broadcom.com>
Date: Tue, 21 May 2013 15:57:31 -0700

> This patch fixes an issue that was recently observed on one platform after few
> hundred suspend/resume loops. The code has existed since day one and affects
> every tg3 device. Due to the scope of the devices affected, submitting this
> patch to net-next to let it bake for sometime before submitting to stable.

If it's suitable for -stable, it has to be suitable for 'net', so that's
where I applied it.

This really isn't complicated.

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

end of thread, other threads:[~2013-05-22 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 22:57 [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug Nithin Nayak Sujir
2013-05-21 22:57 ` [PATCH net-next 1/2] tg3: Ensure boot code has completed initialization before accessing hardware Nithin Nayak Sujir
2013-05-21 22:57 ` [PATCH net-next 2/2] tg3: Update version to 3.132 Nithin Nayak Sujir
2013-05-22 21:51 ` [PATCH net-next 0/2] tg3: Fix boot code initialization handshake bug David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.