bounce: allow use of bounce pool via config option (Bounce
[opensuse:kernel-source.git] / patches.fixes / mm-bounce-allow-use-of-bounce-pool-via-config-option.patch
1 From: Chris Metcalf <cmetcalf@tilera.com>
2 Date: Sat, 16 Jun 2012 16:41:05 -0400
3 Subject: [PATCH] bounce: allow use of bounce pool via config option
4
5 References: Bounce memory pool initialisation (bnc#836347)
6 Patch-mainline: Yes (v3.6)
7 Git-commit: f1006257893917dfb1e0d74cb47b18c0e2908693
8
9 The tilegx USB OHCI support needs the bounce pool since we're not
10 using the IOMMU to handle 32-bit addresses.
11
12 Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
13 Signed-off-by: Mel Gorman <mgorman@suse.de>
14 ---
15  arch/tile/Kconfig | 6 ++++++
16  mm/bounce.c       | 8 +++++---
17  2 files changed, 11 insertions(+), 3 deletions(-)
18
19 diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig
20 index e4e08b80..33d529a 100644
21 --- a/arch/tile/Kconfig
22 +++ b/arch/tile/Kconfig
23 @@ -341,6 +341,12 @@ config NO_IOPORT
24  
25  source "drivers/pci/Kconfig"
26  
27 +# USB OHCI needs the bounce pool since tilegx will often have more
28 +# than 4GB of memory, but we don't currently use the IOTLB to present
29 +# a 32-bit address to OHCI.  So we need to use a bounce pool instead.
30 +config NEED_BOUNCE_POOL
31 +       def_bool USB_OHCI_HCD
32 +
33  config HOTPLUG
34         bool "Support for hot-pluggable devices"
35         ---help---
36 diff --git a/mm/bounce.c b/mm/bounce.c
37 index 192f29d..a780971 100644
38 --- a/mm/bounce.c
39 +++ b/mm/bounce.c
40 @@ -24,23 +24,25 @@
41  
42  static mempool_t *page_pool, *isa_page_pool;
43  
44 -#ifdef CONFIG_HIGHMEM
45 +#if defined(CONFIG_HIGHMEM) || defined(CONFIG_NEED_BOUNCE_POOL)
46  static __init int init_emergency_pool(void)
47  {
48 -#ifndef CONFIG_MEMORY_HOTPLUG
49 +#if defined(CONFIG_HIGHMEM) && !defined(CONFIG_MEMORY_HOTPLUG)
50         if (max_pfn <= max_low_pfn)
51                 return 0;
52  #endif
53  
54         page_pool = mempool_create_page_pool(POOL_SIZE, 0);
55         BUG_ON(!page_pool);
56 -       printk("highmem bounce pool size: %d pages\n", POOL_SIZE);
57 +       printk("bounce pool size: %d pages\n", POOL_SIZE);
58  
59         return 0;
60  }
61  
62  __initcall(init_emergency_pool);
63 +#endif
64  
65 +#ifdef CONFIG_HIGHMEM
66  /*
67   * highmem version, map in to vec
68   */