From 94fd1de1eed0f548fa70239a887bc83adbdfa1df Mon Sep 17 00:00:00 2001 From: sruffell Date: Thu, 13 Aug 2009 20:18:58 +0000 Subject: voicebus: Define CONFIG_STORE_USER on 2.6.22 when CONFIG_SLUB is defined. This is to work around a known issue with linux 2.6.22. For more information see http://thread.gmane.org/gmane.linux.kernel/618031 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4677 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- kernel/voicebus.c | 11 +++++++++-- 1 file 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"); -- cgit v1.2.3