tg3: Fix boot code initialization handshake bug
Subsystems (3)
cover tg3: Fix boot code initialization handshake bug
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(-)
Signature · 1 line
1.8.1.4
PATCH 1/2 tg3: Ensure boot code has completed initialization before accessing hardware
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.
--- drivers/net/ethernet/broadcom/tg3.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +4 -4
@@ -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) &&
Signature · 1 line
1.8.1.4
PATCH 2/2 tg3: Update version to 3.132
In reply to Nithin Nayak Sujir--- drivers/net/ethernet/broadcom/tg3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +2 -2
@@ -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
Signature · 1 line
1.8.1.4
David Miller
maintainerFrom: "Nithin Nayak Sujir" <[email protected]>
Date: Tue, 21 May 2013 15:57:31 -0700
Quoted 4 lines
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.