aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_main.c
diff options
context:
space:
mode:
authorHannes Hering <hannes.hering@linux.vnet.ibm.com>2008-05-07 08:43:36 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-13 01:31:39 -0400
commit48cfb14f8b89d4d5b3df6c16f08b258686fb12ad (patch)
treeaa517fe0c85010784e24b7f3d9b568f7197aa9fa /drivers/net/ehea/ehea_main.c
parentfb7b6ca2b6b7c23b52be143bdd5f55a23b9780c8 (diff)
ehea: Add DLPAR memory remove support
The eHEA driver uses the recently modified walk_memory_resource for powerpc functionality to detect the memory layout. It further uses the memory hotplug notifiers to catch memory hotplug events. 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.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index f9bc21c74b59..d1b6d4e7495d 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -35,6 +35,7 @@
35#include <linux/if_ether.h> 35#include <linux/if_ether.h>
36#include <linux/notifier.h> 36#include <linux/notifier.h>
37#include <linux/reboot.h> 37#include <linux/reboot.h>
38#include <linux/memory.h>
38#include <asm/kexec.h> 39#include <asm/kexec.h>
39#include <linux/mutex.h> 40#include <linux/mutex.h>
40 41
@@ -3503,6 +3504,24 @@ void ehea_crash_handler(void)
3503 0, H_DEREG_BCMC); 3504 0, H_DEREG_BCMC);
3504} 3505}
3505 3506
3507static int ehea_mem_notifier(struct notifier_block *nb,
3508 unsigned long action, void *data)
3509{
3510 switch (action) {
3511 case MEM_OFFLINE:
3512 ehea_info("memory has been removed");
3513 ehea_rereg_mrs(NULL);
3514 break;
3515 default:
3516 break;
3517 }
3518 return NOTIFY_OK;
3519}
3520
3521static struct notifier_block ehea_mem_nb = {
3522 .notifier_call = ehea_mem_notifier,
3523};
3524
3506static int ehea_reboot_notifier(struct notifier_block *nb, 3525static int ehea_reboot_notifier(struct notifier_block *nb,
3507 unsigned long action, void *unused) 3526 unsigned long action, void *unused)
3508{ 3527{
@@ -3581,6 +3600,10 @@ int __init ehea_module_init(void)
3581 if (ret) 3600 if (ret)
3582 ehea_info("failed registering reboot notifier"); 3601 ehea_info("failed registering reboot notifier");
3583 3602
3603 ret = register_memory_notifier(&ehea_mem_nb);
3604 if (ret)
3605 ehea_info("failed registering memory remove notifier");
3606
3584 ret = crash_shutdown_register(&ehea_crash_handler); 3607 ret = crash_shutdown_register(&ehea_crash_handler);
3585 if (ret) 3608 if (ret)
3586 ehea_info("failed registering crash handler"); 3609 ehea_info("failed registering crash handler");
@@ -3604,6 +3627,7 @@ int __init ehea_module_init(void)
3604out3: 3627out3:
3605 ibmebus_unregister_driver(&ehea_driver); 3628 ibmebus_unregister_driver(&ehea_driver);
3606out2: 3629out2:
3630 unregister_memory_notifier(&ehea_mem_nb);
3607 unregister_reboot_notifier(&ehea_reboot_nb); 3631 unregister_reboot_notifier(&ehea_reboot_nb);
3608 crash_shutdown_unregister(&ehea_crash_handler); 3632 crash_shutdown_unregister(&ehea_crash_handler);
3609out: 3633out:
@@ -3621,6 +3645,7 @@ static void __exit ehea_module_exit(void)
3621 ret = crash_shutdown_unregister(&ehea_crash_handler); 3645 ret = crash_shutdown_unregister(&ehea_crash_handler);
3622 if (ret) 3646 if (ret)
3623 ehea_info("failed unregistering crash handler"); 3647 ehea_info("failed unregistering crash handler");
3648 unregister_memory_notifier(&ehea_mem_nb);
3624 kfree(ehea_fw_handles.arr); 3649 kfree(ehea_fw_handles.arr);
3625 kfree(ehea_bcmc_regs.arr); 3650 kfree(ehea_bcmc_regs.arr);
3626 ehea_destroy_busmap(); 3651 ehea_destroy_busmap();