diff options
author | Hannes Hering <hannes.hering@linux.vnet.ibm.com> | 2008-10-16 05:36:42 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-10-22 06:22:17 -0400 |
commit | d4f12daf7ba4efc506c377a9591ecdb692641fe5 (patch) | |
tree | c2a94e5f6a012adfc94b52a30daed50229320edb /drivers/net/ehea/ehea_main.c | |
parent | 93fbaae188fba7c2a6e458f62e1f61439caebfc8 (diff) |
ehea: Fix memory hotplug support
This patch implements the memory notifier to update the busmap
instantly instead of rebuilding the whole map. This is necessary
because walk_memory_resource provides different information than
required during memory hotplug.
Signed-off-by: Hannes Hering <hering2@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index b70c5314f537..422fcb93e2c3 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -2863,7 +2863,7 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2863 | struct ehea_adapter *adapter; | 2863 | struct ehea_adapter *adapter; |
2864 | 2864 | ||
2865 | mutex_lock(&dlpar_mem_lock); | 2865 | mutex_lock(&dlpar_mem_lock); |
2866 | ehea_info("LPAR memory enlarged - re-initializing driver"); | 2866 | ehea_info("LPAR memory changed - re-initializing driver"); |
2867 | 2867 | ||
2868 | list_for_each_entry(adapter, &adapter_list, list) | 2868 | list_for_each_entry(adapter, &adapter_list, list) |
2869 | if (adapter->active_ports) { | 2869 | if (adapter->active_ports) { |
@@ -2900,13 +2900,6 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2900 | } | 2900 | } |
2901 | } | 2901 | } |
2902 | 2902 | ||
2903 | ehea_destroy_busmap(); | ||
2904 | ret = ehea_create_busmap(); | ||
2905 | if (ret) { | ||
2906 | ehea_error("creating ehea busmap failed"); | ||
2907 | goto out; | ||
2908 | } | ||
2909 | |||
2910 | clear_bit(__EHEA_STOP_XFER, &ehea_driver_flags); | 2903 | clear_bit(__EHEA_STOP_XFER, &ehea_driver_flags); |
2911 | 2904 | ||
2912 | list_for_each_entry(adapter, &adapter_list, list) | 2905 | list_for_each_entry(adapter, &adapter_list, list) |
@@ -3519,9 +3512,21 @@ void ehea_crash_handler(void) | |||
3519 | static int ehea_mem_notifier(struct notifier_block *nb, | 3512 | static int ehea_mem_notifier(struct notifier_block *nb, |
3520 | unsigned long action, void *data) | 3513 | unsigned long action, void *data) |
3521 | { | 3514 | { |
3515 | struct memory_notify *arg = data; | ||
3522 | switch (action) { | 3516 | switch (action) { |
3523 | case MEM_OFFLINE: | 3517 | case MEM_CANCEL_OFFLINE: |
3524 | ehea_info("memory has been removed"); | 3518 | ehea_info("memory offlining canceled"); |
3519 | /* Readd canceled memory block */ | ||
3520 | case MEM_ONLINE: | ||
3521 | ehea_info("memory is going online"); | ||
3522 | if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages)) | ||
3523 | return NOTIFY_BAD; | ||
3524 | ehea_rereg_mrs(NULL); | ||
3525 | break; | ||
3526 | case MEM_GOING_OFFLINE: | ||
3527 | ehea_info("memory is going offline"); | ||
3528 | if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages)) | ||
3529 | return NOTIFY_BAD; | ||
3525 | ehea_rereg_mrs(NULL); | 3530 | ehea_rereg_mrs(NULL); |
3526 | break; | 3531 | break; |
3527 | default: | 3532 | default: |