diff options
-rw-r--r-- | kernel/voicebus.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/kernel/voicebus.c b/kernel/voicebus.c index aabfd8c..2a2183c 100644 --- a/kernel/voicebus.c +++ b/kernel/voicebus.c @@ -1322,6 +1322,7 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, { int retval = 0; struct voicebus *vb; + unsigned long cache_flags; assert(NULL != pdev); assert(NULL != board_name); @@ -1379,15 +1380,21 @@ voicebus_init(struct pci_dev *pdev, u32 framesize, vb->handle_receive = handle_receive; vb->handle_transmit = handle_transmit; vb->context = context; + +#if defined(CONFIG_SLUB) && (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 22)) + cache_flags = SLAB_HWCACHE_ALIGN | SLAB_STORE_USER | SLAB_DEBUG_FREE; +#else + cache_flags = SLAB_HWCACHE_ALIGN; +#endif /* \todo This cache should be shared by all instances supported by * this driver. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) vb->buffer_cache = kmem_cache_create(board_name, vb->framesize, 0, - SLAB_HWCACHE_ALIGN, NULL, NULL); + cache_flags, NULL, NULL); #else vb->buffer_cache = kmem_cache_create(board_name, vb->framesize, 0, - SLAB_HWCACHE_ALIGN, NULL); + cache_flags, NULL); #endif if (NULL == vb->buffer_cache) { VB_PRINTK(vb, ERR, "Failed to allocate buffer cache.\n"); |