From 71c47209f5ffcbd0238e86adaafaa6e53ea1ae0a Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Tue, 15 Jul 2003 15:45:41 +0000 Subject: [PATCH] Be careful to call bus_dmamap_load with BUS_DMA_NOWAIT so that the callback will never be deferred. ATM needs to prevent cell and packet ordering. Also use the default mutex and lock functions (those that panic) for the tag creation. --- sys/dev/en/midway.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c index d70d23649c7..1d2a3854eb9 100644 --- a/sys/dev/en/midway.c +++ b/sys/dev/en/midway.c @@ -750,7 +750,7 @@ en_txdma(struct en_softc *sc, struct en_txslot *slot) * Try to load that map */ error = bus_dmamap_load_mbuf(sc->txtag, map->map, tx.m, - en_txdma_load, &tx, 0); + en_txdma_load, &tx, BUS_DMA_NOWAIT); if (lastm != NULL) lastm->m_next = NULL; @@ -2311,7 +2311,7 @@ en_service(struct en_softc *sc) } rx.m = m; error = bus_dmamap_load_mbuf(sc->txtag, map->map, m, - en_rxdma_load, &rx, 0); + en_rxdma_load, &rx, BUS_DMA_NOWAIT); if (error != 0) { if_printf(&sc->ifatm.ifnet, "loading RX map failed " @@ -2706,8 +2706,8 @@ en_dmaprobe(struct en_softc *sc) */ err = bus_dma_tag_create(NULL, MIDDMA_MAXBURST, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0, busdma_lock_mutex, - &Giant, &tag); + 3 * MIDDMA_MAXBURST, 1, 3 * MIDDMA_MAXBURST, 0, + NULL, NULL, &tag); if (err) panic("%s: cannot create test DMA tag %d", __func__, err); @@ -2716,7 +2716,7 @@ en_dmaprobe(struct en_softc *sc) panic("%s: cannot allocate test DMA memory %d", __func__, err); err = bus_dmamap_load(tag, map, buffer, 3 * MIDDMA_MAXBURST, - en_dmaprobe_load, &phys, 0); + en_dmaprobe_load, &phys, BUS_DMA_NOWAIT); if (err) panic("%s: cannot load test DMA map %d", __func__, err); addr = buffer; @@ -2919,8 +2919,8 @@ en_attach(struct en_softc *sc) if (bus_dma_tag_create(NULL, 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, - EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0, busdma_lock_mutex, - &Giant, &sc->txtag)) + EN_TXSZ * 1024, EN_MAX_DMASEG, EN_TXSZ * 1024, 0, + NULL, NULL, &sc->txtag)) goto fail; sc->map_zone = uma_zcreate("en dma maps", sizeof(struct en_map),