]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/ppc-pseries_pfn-mem-rm.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / ppc-pseries_pfn-mem-rm.patch
CommitLineData
2cb7cef9
BS
1Subject: Bug 435181 - DMEM add caused kernel opps after ehca rejected request
2From: olh@suse.de
3References: 435181
4
5---
6 arch/powerpc/platforms/pseries/hotplug-memory.c | 12 ++++++++++++
7 mm/memory_hotplug.c | 4 ++--
8 2 files changed, 14 insertions(+), 2 deletions(-)
9
10--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
11+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
12@@ -22,6 +22,18 @@ static int pseries_remove_lmb(unsigned l
13 int ret;
14
15 start_pfn = base >> PAGE_SHIFT;
16+
17+ if (!pfn_valid(start_pfn)) {
18+ /*
19+ * Failing hotplug memory add will end up calling
20+ * remove device node to clean up. Since its already
21+ * added to lmbs, we need to remove it and pretend
82094b55 22+ * success.
2cb7cef9
BS
23+ */
24+ lmb_remove(base, lmb_size);
25+ return 0;
26+ }
27+
28 zone = page_zone(pfn_to_page(start_pfn));
29
30 /*
31--- a/mm/memory_hotplug.c
32+++ b/mm/memory_hotplug.c
33@@ -323,11 +323,11 @@ int __remove_pages(struct zone *zone, un
34 BUG_ON(phys_start_pfn & ~PAGE_SECTION_MASK);
35 BUG_ON(nr_pages % PAGES_PER_SECTION);
36
37- release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE);
38-
39 sections_to_remove = nr_pages / PAGES_PER_SECTION;
40 for (i = 0; i < sections_to_remove; i++) {
41 unsigned long pfn = phys_start_pfn + i*PAGES_PER_SECTION;
42+ release_mem_region(pfn << PAGE_SHIFT,
43+ PAGES_PER_SECTION << PAGE_SHIFT);
44 ret = __remove_section(zone, __pfn_to_section(pfn));
45 if (ret)
46 break;