Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Revert last accidental commits.



details:   https://anonhg.NetBSD.org/src/rev/1d0dd0ee2695
branches:  trunk
changeset: 368741:1d0dd0ee2695
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Aug 01 07:37:18 2022 +0000

description:
Revert last accidental commits.

diffstat:

 sys/dev/ic/ahcisata_core.c |    28 +-
 sys/dev/ic/bcmgenet.c      |    12 +-
 sys/dev/ic/nvmevar.h       |    79 +--
 sys/dev/ic/rtl8169.c       |     8 +-
 sys/dev/ic/tulip.c         |  1103 +++++++++++++++++++++----------------------
 sys/dev/ic/tulipreg.h      |     8 +-
 6 files changed, 567 insertions(+), 671 deletions(-)

diffs (truncated from 3355 to 300 lines):

diff -r 8533e939eea8 -r 1d0dd0ee2695 sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Mon Aug 01 07:34:28 2022 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Mon Aug 01 07:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_core.c,v 1.106 2022/08/01 07:34:28 mlelstv Exp $      */
+/*     $NetBSD: ahcisata_core.c,v 1.107 2022/08/01 07:37:18 mlelstv Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.106 2022/08/01 07:34:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.107 2022/08/01 07:37:18 mlelstv Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -828,8 +828,8 @@
                                 */
                                return ERROR;
                        }
-                       aprint_debug("%s port %d: error 0x%x sending FIS, t %d\n",
-                           AHCINAME(sc), chp->ch_channel, is, timeout);
+                       aprint_debug("%s port %d: error 0x%x sending FIS\n",
+                           AHCINAME(sc), chp->ch_channel, is);
                        return ERR_DF;
                }
                ata_delay(chp, 10, "ahcifis", flags);
@@ -1635,27 +1635,9 @@
                /* XXX controller reset ? */
                return;
        }
+
        if (sc->sc_channel_stop)
                sc->sc_channel_stop(sc, chp);
-       if ((AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FRE) == 0)
-               return;
-
-       AHCI_WRITE(sc, AHCI_P_CMD(chp->ch_channel),
-           AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & ~AHCI_P_CMD_FRE);
-       /* wait 1s for FIS receive to stop */
-       for (i = 0; i <100; i++) {
-               if ((AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FR)
-                   == 0)
-                       break;
-               if (flags & AT_WAIT)
-                       tsleep(&sc, PRIBIO, "ahcistop", mstohz(10));
-               else
-                       delay(10000);
-       }
-       if (AHCI_READ(sc, AHCI_P_CMD(chp->ch_channel)) & AHCI_P_CMD_FR) {
-               printf("%s: channel FIS receive wouldn't stop\n", AHCINAME(sc));
-               /* XXX controller reset ? */
-       }
 }
 
 static void
diff -r 8533e939eea8 -r 1d0dd0ee2695 sys/dev/ic/bcmgenet.c
--- a/sys/dev/ic/bcmgenet.c     Mon Aug 01 07:34:28 2022 +0000
+++ b/sys/dev/ic/bcmgenet.c     Mon Aug 01 07:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcmgenet.c,v 1.12 2022/08/01 07:34:28 mlelstv Exp $ */
+/* $NetBSD: bcmgenet.c,v 1.13 2022/08/01 07:37:18 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 2020 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -34,7 +34,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.12 2022/08/01 07:34:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcmgenet.c,v 1.13 2022/08/01 07:37:18 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -730,8 +730,7 @@
                        bus_dmamap_sync(sc->sc_rx.buf_tag, sc->sc_rx.buf_map[index].map,
                            0, sc->sc_rx.buf_map[index].map->dm_mapsize,
                            BUS_DMASYNC_POSTREAD);
-               } else
-                       device_printf(sc->sc_dev, "RXINTR empty %d\n",index);
+               }
                bus_dmamap_unload(sc->sc_rx.buf_tag, sc->sc_rx.buf_map[index].map);
                sc->sc_rx.buf_map[index].mbuf = NULL;
 
@@ -785,19 +784,18 @@
                                bus_dmamap_sync(sc->sc_tx.buf_tag, bmap->map,
                                    0, bmap->map->dm_mapsize,
                                    BUS_DMASYNC_POSTWRITE);
-                       } else
-                               device_printf(sc->sc_dev, "TXINTR empty %d\n",i);
+                       }
                        bus_dmamap_unload(sc->sc_tx.buf_tag, bmap->map);
                        m_freem(bmap->mbuf);
                        bmap->mbuf = NULL;
                        ++pkts;
                }
 
+               ifp->if_flags &= ~IFF_OACTIVE;
                i = TX_NEXT(i);
                sc->sc_tx.cidx = (sc->sc_tx.cidx + 1) & 0xffff;
        }
 
-       ifp->if_flags &= ~IFF_OACTIVE;
        if_statadd(ifp, if_opackets, pkts);
 
        if (pkts != 0)
diff -r 8533e939eea8 -r 1d0dd0ee2695 sys/dev/ic/nvmevar.h
--- a/sys/dev/ic/nvmevar.h      Mon Aug 01 07:34:28 2022 +0000
+++ b/sys/dev/ic/nvmevar.h      Mon Aug 01 07:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmevar.h,v 1.25 2022/08/01 07:34:28 mlelstv Exp $     */
+/*     $NetBSD: nvmevar.h,v 1.26 2022/08/01 07:37:18 mlelstv Exp $     */
 /*     $OpenBSD: nvmevar.h,v 1.8 2016/04/14 11:18:32 dlg Exp $ */
 
 /*
@@ -78,8 +78,6 @@
        kmutex_t                q_cq_mtx;
        struct nvme_dmamem      *q_sq_dmamem;
        struct nvme_dmamem      *q_cq_dmamem;
-       struct nvme_dmamem      *q_nvmmu_dmamem; /* for apple m1 nvme */
-
        bus_size_t              q_sqtdbl; /* submission queue tail doorbell */
        bus_size_t              q_cqhdbl; /* completion queue head doorbell */
        uint16_t                q_id;
@@ -104,32 +102,9 @@
 #define        NVME_NS_F_OPEN  __BIT(0)
 };
 
-struct nvme_ops {
-       void            (*op_enable)(struct nvme_softc *);
-
-       int             (*op_q_alloc)(struct nvme_softc *,
-                             struct nvme_queue *);
-       void            (*op_q_free)(struct nvme_softc *,
-                             struct nvme_queue *);
-
-       uint32_t        (*op_sq_enter)(struct nvme_softc *,
-                             struct nvme_queue *, struct nvme_ccb *);
-       void            (*op_sq_leave)(struct nvme_softc *,
-                             struct nvme_queue *, struct nvme_ccb *);
-       uint32_t        (*op_sq_enter_locked)(struct nvme_softc *,
-                             struct nvme_queue *, struct nvme_ccb *);
-       void            (*op_sq_leave_locked)(struct nvme_softc *,
-                             struct nvme_queue *, struct nvme_ccb *);
-
-       void            (*op_cq_done)(struct nvme_softc *,
-                             struct nvme_queue *, struct nvme_ccb *);
-};
-
 struct nvme_softc {
        device_t                sc_dev;
 
-       const struct nvme_ops   *sc_ops;
-
        bus_space_tag_t         sc_iot;
        bus_space_handle_t      sc_ioh;
        bus_size_t              sc_ios;
@@ -143,10 +118,9 @@
        void                    **sc_softih;    /* softintr handlers */
 
        u_int                   sc_rdy_to;      /* RDY timeout */
-       size_t                  sc_mps;         /* memory page size */
+       size_t                  sc_mps;         /* memory page size */  
        size_t                  sc_mdts;        /* max data trasfer size */
        u_int                   sc_max_sgl;     /* max S/G segments */
-       u_int                   sc_dstrd;
 
        struct nvm_identify_controller
                                sc_identify;
@@ -165,9 +139,6 @@
 
        uint32_t                sc_quirks;
 #define        NVME_QUIRK_DELAY_B4_CHK_RDY     __BIT(0)
-#define        NVME_QUIRK_NOMSI                __BIT(1)
-
-       char                    sc_modelname[81];
 };
 
 #define        lemtoh16(p)     le16toh(*((uint16_t *)(p)))
@@ -181,46 +152,21 @@
        uint16_t        naa_nsid;
        uint32_t        naa_qentries;   /* total number of queue slots */
        uint32_t        naa_maxphys;    /* maximum device transfer size */
-       const char      *naa_typename;  /* identifier */
 };
 
 int    nvme_attach(struct nvme_softc *);
 int    nvme_detach(struct nvme_softc *, int flags);
 int    nvme_rescan(device_t, const char *, const int *);
 void   nvme_childdet(device_t, device_t);
-int    nvme_suspend(struct nvme_softc *);
-int    nvme_resume(struct nvme_softc *);
 int    nvme_intr(void *);
 void   nvme_softintr_intx(void *);
 int    nvme_intr_msi(void *);
 void   nvme_softintr_msi(void *);
 
 static __inline struct nvme_queue *
-nvme_get_q(struct nvme_softc *sc, struct buf *bp, bool waitok)
+nvme_get_q(struct nvme_softc *sc)
 {
-       struct nvme_queue *q;
-       u_int cpunum;
-
-       cpunum = cpu_index(curcpu());
-
-       /* try own queue */
-       q = sc->sc_q[cpunum % sc->sc_nq];
-       if (waitok)
-               return q;
-
-       /* if busy, search for an idle queue */
-       if (SIMPLEQ_EMPTY(&q->q_ccb_list)) {
-               for (u_int qoff = 1; qoff < sc->sc_nq; qoff++) {
-                       struct nvme_queue *t;
-                       t = sc->sc_q[(cpunum + qoff) % sc->sc_nq];
-                       if (t->q_sq_tail == t->q_cq_head) {
-                               q = t;
-                               break;
-                       }
-               }
-       }
-
-       return q;
+       return sc->sc_q[cpu_index(curcpu()) % sc->sc_nq];
 }
 
 /*
@@ -234,26 +180,9 @@
        return &sc->sc_namespaces[nsid - 1];
 }
 
-#define nvme_read4(_s, _r) \
-       bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r))
-#define nvme_write4(_s, _r, _v) \
-       bus_space_write_4((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v))
-uint64_t
-       nvme_read8(struct nvme_softc *, bus_size_t);
-void   nvme_write8(struct nvme_softc *, bus_size_t, uint64_t);
-
-#define nvme_barrier(_s, _r, _l, _f) \
-       bus_space_barrier((_s)->sc_iot, (_s)->sc_ioh, (_r), (_l), (_f))
-
-struct nvme_dmamem *
-       nvme_dmamem_alloc(struct nvme_softc *, size_t);
-void   nvme_dmamem_free(struct nvme_softc *, struct nvme_dmamem *);
-void   nvme_dmamem_sync(struct nvme_softc *, struct nvme_dmamem *, int);
-
 int    nvme_ns_identify(struct nvme_softc *, uint16_t);
 void   nvme_ns_free(struct nvme_softc *, uint16_t);
 int    nvme_ns_dobio(struct nvme_softc *, uint16_t, void *,
     struct buf *, void *, size_t, int, daddr_t, int, nvme_nnc_done);
 int    nvme_ns_sync(struct nvme_softc *, uint16_t, int);
 int    nvme_admin_getcache(struct nvme_softc *, int *);
-int    nvme_admin_setcache(struct nvme_softc *, int);
diff -r 8533e939eea8 -r 1d0dd0ee2695 sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Mon Aug 01 07:34:28 2022 +0000
+++ b/sys/dev/ic/rtl8169.c      Mon Aug 01 07:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.173 2022/08/01 07:34:28 mlelstv Exp $    */
+/*     $NetBSD: rtl8169.c,v 1.174 2022/08/01 07:37:18 mlelstv Exp $    */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.173 2022/08/01 07:34:28 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.174 2022/08/01 07:37:18 mlelstv Exp $");
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -682,8 +682,8 @@
                case RTK_HWREV_8168H:
                case RTK_HWREV_8411B:
                        sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
-                           RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_PHYWAKE_PM |
-                           RTKQ_NOJUMBO | RTKQ_RXDV_GATED | RTKQ_TXRXEN_LATER;
+                           RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_NOJUMBO | 
+                           RTKQ_RXDV_GATED | RTKQ_TXRXEN_LATER;
                        break;
                case RTK_HWREV_8100E:
                case RTK_HWREV_8100E_SPIN2:
diff -r 8533e939eea8 -r 1d0dd0ee2695 sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Mon Aug 01 07:34:28 2022 +0000
+++ b/sys/dev/ic/tulip.c        Mon Aug 01 07:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp $      */
+/*     $NetBSD: tulip.c,v 1.207 2022/08/01 07:37:18 mlelstv Exp $      */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@@ -36,8 +36,9 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.206 2022/08/01 07:34:28 mlelstv Exp $");



Home | Main Index | Thread Index | Old Index