Skip to content

Commit

Permalink
tg3: Ensure boot code has completed initialization before accessing h…
Browse files Browse the repository at this point in the history
…ardware

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nithin Sujir authored and David S. Miller committed May 22, 2013
1 parent 3ccfc1b commit fb03a43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -8911,6 +8911,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) {
Expand Down Expand Up @@ -8941,10 +8945,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) &&
Expand Down

0 comments on commit fb03a43

Please sign in to comment.