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.
This commit is contained in:
parent
38fa6bf3dc
commit
71c47209f5
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user