Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci - Fix a bug that bge can't be initialized correc...



details:   https://anonhg.NetBSD.org/src/rev/73d2fdd78267
branches:  trunk
changeset: 330845:73d2fdd78267
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Jul 24 07:33:24 2014 +0000

description:
- Fix a bug that bge can't be initialized correctly on some sparc64 systems
  (PR#49018).
  See also: http://mail-index.netbsd.org/port-sparc64/2013/10/28/msg002036.html
- Change initializaton order as the same as the document, Linux tg3 and FreeBSD
  (part of r241436).

diffstat:

 sys/dev/pci/if_bge.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (56 lines):

diff -r 85e6ad1f4714 -r 73d2fdd78267 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Wed Jul 23 21:19:33 2014 +0000
+++ b/sys/dev/pci/if_bge.c      Thu Jul 24 07:33:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.273 2014/07/22 17:25:19 msaitoh Exp $     */
+/*     $NetBSD: if_bge.c,v 1.274 2014/07/24 07:33:24 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.273 2014/07/22 17:25:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.274 2014/07/24 07:33:24 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2176,7 +2176,7 @@
                        aprint_error_dev(sc->bge_dev, "reset timed out\n");
                        return -1;
                }
-       } else if ((sc->bge_flags & BGEF_NO_EEPROM) == 0) {
+       } else {
                /*
                 * Poll the value location we just wrote until
                 * we see the 1's complement of the magic number.
@@ -2191,7 +2191,8 @@
                        DELAY(10);
                }
 
-               if (i >= BGE_TIMEOUT) {
+               if ((i >= BGE_TIMEOUT)
+                   && ((sc->bge_flags & BGEF_NO_EEPROM) == 0)) {
                        aprint_error_dev(sc->bge_dev,
                            "firmware handshake timed out, val = %x\n", val);
                        return -1;
@@ -4273,14 +4274,14 @@
                BGE_SETBIT(sc, BGE_TLP_CONTROL_REG, BGE_TLP_DATA_FIFO_PROTECT);
        }
 
+       /* 5718 reset step 12, 57XX step 15 and 16 */
+       /* Fix up byte swapping */
+       CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS);
+
        /* 5718 reset step 13, 57XX step 17 */
        /* Poll until the firmware initialization is complete */
        bge_poll_fw(sc);
 
-       /* 5718 reset step 12, 57XX step 15 and 16 */
-       /* Fix up byte swapping */
-       CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS);
-
        /* 57XX step 21 */
        if (BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5704_BX) {
                pcireg_t msidata;



Home | Main Index | Thread Index | Old Index