1 Subject: Bug 435181 - DMEM add caused kernel opps after ehca rejected request
6 arch/powerpc/platforms/pseries/hotplug-memory.c | 12 ++++++++++++
7 mm/memory_hotplug.c | 4 ++--
8 2 files changed, 14 insertions(+), 2 deletions(-)
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
15 start_pfn = base >> PAGE_SHIFT;
17 + if (!pfn_valid(start_pfn)) {
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
24 + lmb_remove(base, lmb_size);
28 zone = page_zone(pfn_to_page(start_pfn));
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);
37 - release_mem_region(phys_start_pfn << PAGE_SHIFT, nr_pages * PAGE_SIZE);
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));