Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci msk(4): ack Status BMU IRQ only if we're (appare...



details:   https://anonhg.NetBSD.org/src/rev/1eb73f3e9170
branches:  trunk
changeset: 971989:1eb73f3e9170
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon May 11 23:47:45 2020 +0000

description:
msk(4): ack Status BMU IRQ only if we're (apparently) caught up with it

Possibility for acking an unprocessed Status BMU IRQ still exists, and
remains handled by the watchdog.  Nevertheless this should reduce the
likelyhood that path is taken.

diffstat:

 sys/dev/pci/if_msk.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r e7f7347d3dbe -r 1eb73f3e9170 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c      Mon May 11 21:51:25 2020 +0000
+++ b/sys/dev/pci/if_msk.c      Mon May 11 23:47:45 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.112 2020/05/11 19:17:46 jakllsch Exp $ */
+/* $NetBSD: if_msk.c,v 1.113 2020/05/11 23:47:45 jakllsch Exp $ */
 /*     $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $     */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.112 2020/05/11 19:17:46 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.113 2020/05/11 23:47:45 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2277,6 +2277,7 @@
        struct ifnet            *ifp0 = NULL, *ifp1 = NULL;
        uint32_t                status;
        struct msk_status_desc  *cur_st;
+       bool                    retried = false;
 
        status = CSR_READ_4(sc, SK_Y2_ISSR2);
        if (status == 0xffffffff)
@@ -2303,6 +2304,7 @@
                msk_intr_yukon(sc_if1);
        }
 
+again:
        MSK_CDSTSYNC(sc, sc->sk_status_idx,
            BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
        cur_st = &sc->sk_status_ring[sc->sk_status_idx];
@@ -2336,8 +2338,11 @@
                cur_st = &sc->sk_status_ring[sc->sk_status_idx];
        }
 
-       if (status & SK_Y2_IMR_BMU) {
+       if (CSR_READ_2(sc, SK_STAT_BMU_PUTIDX) == sc->sk_status_idx) {
                CSR_WRITE_4(sc, SK_STAT_BMU_CSR, SK_STAT_BMU_IRQ_CLEAR);
+       } else if (!retried) {
+               retried = true;
+               goto again;
        }
 
        CSR_WRITE_4(sc, SK_Y2_ICR, 2);



Home | Main Index | Thread Index | Old Index