Subject: kern/26888: fxp driver results in dmasync errors
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <dheeraj@ece.gatech.edu>
List: netbsd-bugs
Date: 09/08/2004 16:28:31
>Number:         26888
>Category:       kern
>Synopsis:       fxp driver results in dmasync errors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 08 16:29:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dheeraj Reddy
>Release:        -current
>Organization:
GA Tech
>Environment:
NetBSD cc335-lap01 2.0G NetBSD 2.0G (COCLAP) #1: Tue Sep  7 16:14:42 EDT 2004  dheeraj@cc335-lap01:/usr/src/sys/arch/i386/compile/COCLAP i386
>Description:
When using long ftp sessions(1 hour or so) , OR highly interactive ssh sessions (verbose build.sh release over ssh) the fxp driver
suddenly stops working with 'dmasync timeout' errors in the console.

i have to reboot the machine to get it to working again.

---card identity in dmesg-----
fxp0 at pci0 dev 4 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at ioapic1 pin 4 (irq 10)
fxp0: Enabling receiver lock-up workaround
fxp0: Ethernet address 00:e0:81:01:a5:d5
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
---card identity in dmesg-----
>How-To-Repeat:
Transfer a few gigabytes OR run verbose 'build.sh build' over ssh.

>Fix:
--- /usr/src/sys/dev/ic/i82557.c.orig   2004-09-08 12:12:10.000000000 -0400
+++ /usr/src/sys/dev/ic/i82557.c        2004-09-08 12:25:45.000000000 -0400
@@ -1814,11 +1814,11 @@
        CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->sc_cddma + FXP_CDCONFIGOFF);
        fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
        /* ...and wait for it to complete. */
-       i = 1000;
+       i = 10000;
        do {
                FXP_CDCONFIGSYNC(sc,
                    BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
-               DELAY(1);
+               DELAY(2);
        } while ((le16toh(cbp->cb_status) & FXP_CB_STATUS_C) == 0 && --i);
        if (i == 0) {
                printf("%s at line %d: dmasync timeout\n",
@@ -1846,11 +1846,11 @@
        CSR_WRITE_4(sc, FXP_CSR_SCB_GENERAL, sc->sc_cddma + FXP_CDIASOFF);
        fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);
        /* ...and wait for it to complete. */
-       i = 1000;
+       i = 10000;
        do {
                FXP_CDIASSYNC(sc,
                    BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
-               DELAY(1);
+               DELAY(2);
        } while ((le16toh(cb_ias->cb_status) & FXP_CB_STATUS_C) == 0 && --i);
        if (i == 0) {
                printf("%s at line %d: dmasync timeout\n",
@@ -2231,11 +2231,11 @@
        fxp_scb_cmd(sc, FXP_SCB_COMMAND_CU_START);

        /* ...and wait for it to complete. */
-       count = 1000;
+       count = 10000;
        do {
                FXP_CDMCSSYNC(sc,
                    BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE);
-               DELAY(1);
+               DELAY(2);
        } while ((le16toh(mcsp->cb_status) & FXP_CB_STATUS_C) == 0 && --count);
        if (count == 0) {
                printf("%s at line %d: dmasync timeout\n",








the above diff seems to have fixed this issue for me.
>Release-Note:
>Audit-Trail:
>Unformatted: