diff options
-rw-r--r-- | arch/s390/Kconfig | 3 | ||||
-rw-r--r-- | arch/s390/mm/init.c | 13 | ||||
-rw-r--r-- | drivers/s390/char/sclp_cmd.c | 5 |
3 files changed, 20 insertions, 1 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 2ed88122be93..8d41908e2513 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -317,6 +317,9 @@ config ARCH_ENABLE_MEMORY_HOTPLUG | |||
317 | def_bool y | 317 | def_bool y |
318 | depends on SPARSEMEM | 318 | depends on SPARSEMEM |
319 | 319 | ||
320 | config ARCH_ENABLE_MEMORY_HOTREMOVE | ||
321 | def_bool y | ||
322 | |||
320 | source "mm/Kconfig" | 323 | source "mm/Kconfig" |
321 | 324 | ||
322 | comment "I/O subsystem configuration" | 325 | comment "I/O subsystem configuration" |
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 4993b0f594eb..1169130a97ef 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -179,7 +179,7 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
179 | int rc; | 179 | int rc; |
180 | 180 | ||
181 | pgdat = NODE_DATA(nid); | 181 | pgdat = NODE_DATA(nid); |
182 | zone = pgdat->node_zones + ZONE_NORMAL; | 182 | zone = pgdat->node_zones + ZONE_MOVABLE; |
183 | rc = vmem_add_mapping(start, size); | 183 | rc = vmem_add_mapping(start, size); |
184 | if (rc) | 184 | if (rc) |
185 | return rc; | 185 | return rc; |
@@ -189,3 +189,14 @@ int arch_add_memory(int nid, u64 start, u64 size) | |||
189 | return rc; | 189 | return rc; |
190 | } | 190 | } |
191 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 191 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
192 | |||
193 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
194 | int remove_memory(u64 start, u64 size) | ||
195 | { | ||
196 | unsigned long start_pfn, end_pfn; | ||
197 | |||
198 | start_pfn = PFN_DOWN(start); | ||
199 | end_pfn = start_pfn + PFN_DOWN(size); | ||
200 | return offline_pages(start_pfn, end_pfn, 120 * HZ); | ||
201 | } | ||
202 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | ||
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 0c2b77493db4..eb5f1b8bc57f 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -427,6 +427,8 @@ static int sclp_mem_notifier(struct notifier_block *nb, | |||
427 | sclp_attach_storage(id); | 427 | sclp_attach_storage(id); |
428 | switch (action) { | 428 | switch (action) { |
429 | case MEM_ONLINE: | 429 | case MEM_ONLINE: |
430 | case MEM_GOING_OFFLINE: | ||
431 | case MEM_CANCEL_OFFLINE: | ||
430 | break; | 432 | break; |
431 | case MEM_GOING_ONLINE: | 433 | case MEM_GOING_ONLINE: |
432 | rc = sclp_mem_change_state(start, size, 1); | 434 | rc = sclp_mem_change_state(start, size, 1); |
@@ -434,6 +436,9 @@ static int sclp_mem_notifier(struct notifier_block *nb, | |||
434 | case MEM_CANCEL_ONLINE: | 436 | case MEM_CANCEL_ONLINE: |
435 | sclp_mem_change_state(start, size, 0); | 437 | sclp_mem_change_state(start, size, 0); |
436 | break; | 438 | break; |
439 | case MEM_OFFLINE: | ||
440 | sclp_mem_change_state(start, size, 0); | ||
441 | break; | ||
437 | default: | 442 | default: |
438 | rc = -EINVAL; | 443 | rc = -EINVAL; |
439 | break; | 444 | break; |