diff options
| -rw-r--r-- | arch/powerpc/kernel/eeh.c | 20 | ||||
| -rw-r--r-- | arch/powerpc/platforms/powernv/eeh-ioda.c | 3 |
2 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index f22f7b6f6b01..e7b76a6bf150 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
| 29 | #include <linux/proc_fs.h> | 29 | #include <linux/proc_fs.h> |
| 30 | #include <linux/rbtree.h> | 30 | #include <linux/rbtree.h> |
| 31 | #include <linux/reboot.h> | ||
| 31 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
| 32 | #include <linux/spinlock.h> | 33 | #include <linux/spinlock.h> |
| 33 | #include <linux/export.h> | 34 | #include <linux/export.h> |
| @@ -747,6 +748,17 @@ int __exit eeh_ops_unregister(const char *name) | |||
| 747 | return -EEXIST; | 748 | return -EEXIST; |
| 748 | } | 749 | } |
| 749 | 750 | ||
| 751 | static int eeh_reboot_notifier(struct notifier_block *nb, | ||
| 752 | unsigned long action, void *unused) | ||
| 753 | { | ||
| 754 | eeh_set_enable(false); | ||
| 755 | return NOTIFY_DONE; | ||
| 756 | } | ||
| 757 | |||
| 758 | static struct notifier_block eeh_reboot_nb = { | ||
| 759 | .notifier_call = eeh_reboot_notifier, | ||
| 760 | }; | ||
| 761 | |||
| 750 | /** | 762 | /** |
| 751 | * eeh_init - EEH initialization | 763 | * eeh_init - EEH initialization |
| 752 | * | 764 | * |
| @@ -778,6 +790,14 @@ int eeh_init(void) | |||
| 778 | if (machine_is(powernv) && cnt++ <= 0) | 790 | if (machine_is(powernv) && cnt++ <= 0) |
| 779 | return ret; | 791 | return ret; |
| 780 | 792 | ||
| 793 | /* Register reboot notifier */ | ||
| 794 | ret = register_reboot_notifier(&eeh_reboot_nb); | ||
| 795 | if (ret) { | ||
| 796 | pr_warn("%s: Failed to register notifier (%d)\n", | ||
| 797 | __func__, ret); | ||
| 798 | return ret; | ||
| 799 | } | ||
| 800 | |||
| 781 | /* call platform initialization function */ | 801 | /* call platform initialization function */ |
| 782 | if (!eeh_ops) { | 802 | if (!eeh_ops) { |
| 783 | pr_warning("%s: Platform EEH operation not found\n", | 803 | pr_warning("%s: Platform EEH operation not found\n", |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index fcb79cffdb66..f51474336460 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
| @@ -44,7 +44,8 @@ static int ioda_eeh_event(struct notifier_block *nb, | |||
| 44 | 44 | ||
| 45 | /* We simply send special EEH event */ | 45 | /* We simply send special EEH event */ |
| 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && | 46 | if ((changed_evts & OPAL_EVENT_PCI_ERROR) && |
| 47 | (events & OPAL_EVENT_PCI_ERROR)) | 47 | (events & OPAL_EVENT_PCI_ERROR) && |
| 48 | eeh_enabled()) | ||
| 48 | eeh_send_failure_event(NULL); | 49 | eeh_send_failure_event(NULL); |
| 49 | 50 | ||
| 50 | return 0; | 51 | return 0; |
