diff options
author | gonzo <gonzo@FreeBSD.org> | 2013-07-03 23:38:02 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2013-07-03 23:38:02 +0000 |
commit | 4ccb1bebc540925729b559907e85c9f428042c3c (patch) | |
tree | 5a35dd8dca4e148a80f20b225d535c53a3c0a4cd /sys/arm | |
parent | bb909148e91fe6038deabe6aec889b349d126851 (diff) | |
download | FreeBSD-src-4ccb1bebc540925729b559907e85c9f428042c3c.zip FreeBSD-src-4ccb1bebc540925729b559907e85c9f428042c3c.tar.gz |
Fix one of INVARIANTS-related UMA panics on ARM
Force UMA zone to allocate service structures like slabs using own
allocator. uma_debug code performs atomic ops on uma_slab_t fields
and safety of this operation is not guaranteed for write-back caches
Diffstat (limited to 'sys/arm')
-rw-r--r-- | sys/arm/arm/busdma_machdep-v6.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 5324f80..d5da5c7 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -192,14 +192,26 @@ static busdma_bufalloc_t standard_allocator; /* Cache of standard buffers */ static void busdma_init(void *dummy) { + int uma_flags; + + uma_flags = 0; /* Create a cache of buffers in standard (cacheable) memory. */ standard_allocator = busdma_bufalloc_create("buffer", arm_dcache_align, /* minimum_alignment */ NULL, /* uma_alloc func */ NULL, /* uma_free func */ - 0); /* uma_zcreate_flags */ - + uma_flags); /* uma_zcreate_flags */ + +#ifdef INVARIANTS + /* + * Force UMA zone to allocate service structures like + * slabs using own allocator. uma_debug code performs + * atomic ops on uma_slab_t fields and safety of this + * operation is not guaranteed for write-back caches + */ + uma_flags = UMA_ZONE_OFFPAGE; +#endif /* * Create a cache of buffers in uncacheable memory, to implement the * BUS_DMA_COHERENT (and potentially BUS_DMA_NOCACHE) flag. @@ -208,7 +220,7 @@ busdma_init(void *dummy) arm_dcache_align, /* minimum_alignment */ busdma_bufalloc_alloc_uncacheable, busdma_bufalloc_free_uncacheable, - 0); /* uma_zcreate_flags */ + uma_flags); /* uma_zcreate_flags */ } /* |