From 38fb55f1d4d3789de9a985973acad5091a0e222e Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 29 Mar 2012 18:58:02 +0000 Subject: Restore proper use of bounce buffers for ISA DMA. When locking was added, the call to pmap_kextract() was moved up, and as a result the code never updated the physical address to use for DMA if a bounce buffer was used. Restore the earlier location of pmap_kextract() so it takes bounce buffers into account. Tested by: kargl MFC after: 1 week --- sys/x86/isa/isa_dma.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys/x86/isa/isa_dma.c') diff --git a/sys/x86/isa/isa_dma.c b/sys/x86/isa/isa_dma.c index cbc9959..90ee14d 100644 --- a/sys/x86/isa/isa_dma.c +++ b/sys/x86/isa/isa_dma.c @@ -237,8 +237,6 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) caddr_t newaddr; int dma_range_checked; - /* translate to physical */ - phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); dma_range_checked = isa_dmarangecheck(addr, nbytes, chan); #ifdef DIAGNOSTIC @@ -281,6 +279,9 @@ isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan) addr = newaddr; } + /* translate to physical */ + phys = pmap_extract(kernel_pmap, (vm_offset_t)addr); + if (flags & ISADMA_RAW) { dma_auto_mode |= (1 << chan); } else { -- cgit v1.1