aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/core/buffer.c')
-rw-r--r--drivers/usb/core/buffer.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index 684ef70dc09d..506b969ea7fd 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -22,17 +22,25 @@
22 */ 22 */
23 23
24/* FIXME tune these based on pool statistics ... */ 24/* FIXME tune these based on pool statistics ... */
25static const size_t pool_max[HCD_BUFFER_POOLS] = { 25static size_t pool_max[HCD_BUFFER_POOLS] = {
26 /* platforms without dma-friendly caches might need to 26 32, 128, 512, 2048,
27 * prevent cacheline sharing...
28 */
29 32,
30 128,
31 512,
32 PAGE_SIZE / 2
33 /* bigger --> allocate pages */
34}; 27};
35 28
29void __init usb_init_pool_max(void)
30{
31 /*
32 * The pool_max values must never be smaller than
33 * ARCH_KMALLOC_MINALIGN.
34 */
35 if (ARCH_KMALLOC_MINALIGN <= 32)
36 ; /* Original value is okay */
37 else if (ARCH_KMALLOC_MINALIGN <= 64)
38 pool_max[0] = 64;
39 else if (ARCH_KMALLOC_MINALIGN <= 128)
40 pool_max[0] = 0; /* Don't use this pool */
41 else
42 BUILD_BUG(); /* We don't allow this */
43}
36 44
37/* SETUP primitives */ 45/* SETUP primitives */
38 46