Panic when calling _bus_dmamap_load_buffer() with BUS_DMA_COULD_BOUNCE (armv6)

Ian Lepore ian at FreeBSD.org
Fri Feb 15 23:43:34 UTC 2013


On Fri, 2013-02-15 at 14:29 -0800, Thomas Skibo wrote:
> Hello:
> 
> This is the Zedboard port which is the armv6 architecture.  I integrated 
> to my project branch late Wednesday which included some big changes to 
> busdma stuff.  Now my kernel panics early in boot-up.
> 
> I'm getting the a vm_fault when a certain driver calls bus_dmamap_load() 
> with a dma tag with BUS_DMA_COULD_BOUNCE set.
> 
> What appears to be happening is that the code at lines 971-980 in 
> sys/arm/arm/busdma_machdep-v6.c is calling _bus_dmamap_count_pages() 
> before map->pmap is set (it's NULL).  _bus_dmamap_count_pages() in turn 
> calls pmap_extract() with a NULL pointer.
> 
> (_bus_dmamap_count_pages() is inlined by the compiler so doesn't show up 
> in the following back-trace.)
> 
> I patched busdma_machdep-v6.c to get moving again by moving the 
> "map->pmap = pmap" statement before the BUS_DMA_COULD_BOUNCE check.  I'm 
> not suggesting that's the right fix at all.
> 
> ==== //depot/user/skibo/skibo_zynq/sys/arm/arm/busdma_machdep-v6.c#2 - 
> /home/skibo/p4/skibo_zynq/sys/arm/arm/busdma_machdep-v6.c ====
> 970a971,972
> > 	map->pmap = pmap;
> >
> 982d983
> < 	map->pmap = pmap;

Yep, that was exactly the right fix, commited as r246859.  Thanks!

-- Ian




More information about the freebsd-arm mailing list