From 72ce649bd8dd5ae42b995d85e70c0c7d7712d0e5 Mon Sep 17 00:00:00 2001 From: yongari Date: Tue, 4 Jan 2011 19:10:54 +0000 Subject: Partially revert change made in r212061. r212061 relied on bus_dma(9)'s capability which honors boundary restrictions of DMA tag for dynamic buffers. However it seems this does not work well and it triggered watchodg timeouts on controller that has the hardware bug. It's not clear whether there is still another hardware bug not mentioned in errata. This should be revisited since this change shall make use of bounce buffers which in turn reduces performance a lot on systems that have more than 4GB memory. Reported by: Michael L. Squires (mikes <> siralan dot org) Tested by: Michael L. Squires (mikes <> siralan dot org) MFC after: 3 days --- sys/dev/bge/if_bge.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 3f9d6d2..5bddaa2 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -2475,8 +2475,15 @@ bge_dma_alloc(struct bge_softc *sc) boundary = 0; if ((sc->bge_flags & BGE_FLAG_4G_BNDRY_BUG) != 0) boundary = BGE_DMA_BNDRY; + /* + * XXX + * It seems bus_dma(9) still has issue on dealing with boundary + * restriction for dynamic buffers so disable the boundary + * restriction and limit DMA address space to 32bit. It's not + * clear whether there is another hardware issue here. + */ error = bus_dma_tag_create(bus_get_dma_tag(sc->bge_dev), - 1, boundary, lowaddr, BUS_SPACE_MAXADDR, NULL, + 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, &sc->bge_cdata.bge_buffer_tag); if (error != 0) { -- cgit v1.1