From 12c65daeaf7a1811cd5b11cf594386695d78d712 Mon Sep 17 00:00:00 2001 From: Pyun YongHyeon Date: Tue, 7 Sep 2010 18:29:29 +0000 Subject: [PATCH] Make sure to create DMA'able memory for statistics block. This was missed in r212061 and it caused crashes for 570x controllers as controller DMAed statistics to physical address 0. Reported by: kan --- sys/dev/bge/if_bge.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 30ccf22c43df..aff148ff0e3a 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2258,6 +2258,15 @@ bge_dma_alloc(struct bge_softc *sc) if (error) return (error); + /* Create tag for statistics block. */ + error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_STATS_SZ, + &sc->bge_cdata.bge_stats_tag, + (uint8_t **)&sc->bge_ldata.bge_stats, + &sc->bge_cdata.bge_stats_map, + &sc->bge_ldata.bge_stats_paddr, "statistics block"); + if (error) + return (error); + /* Create tag for jumbo RX ring. */ if (BGE_IS_JUMBO_CAPABLE(sc)) { error = bge_dma_ring_alloc(sc, PAGE_SIZE, BGE_JUMBO_RX_RING_SZ,