diff options
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/css.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 08f6e7b6c999..5d83dd471461 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | #include <linux/list.h> | 15 | #include <linux/list.h> |
16 | #include <linux/reboot.h> | ||
16 | 17 | ||
17 | #include "css.h" | 18 | #include "css.h" |
18 | #include "cio.h" | 19 | #include "cio.h" |
@@ -632,6 +633,29 @@ static int __init setup_css(int nr) | |||
632 | return 0; | 633 | return 0; |
633 | } | 634 | } |
634 | 635 | ||
636 | static int css_reboot_event(struct notifier_block *this, | ||
637 | unsigned long event, | ||
638 | void *ptr) | ||
639 | { | ||
640 | int ret, i; | ||
641 | |||
642 | ret = NOTIFY_DONE; | ||
643 | for (i = 0; i <= __MAX_CSSID; i++) { | ||
644 | struct channel_subsystem *css; | ||
645 | |||
646 | css = channel_subsystems[i]; | ||
647 | if (css->cm_enabled) | ||
648 | if (chsc_secm(css, 0)) | ||
649 | ret = NOTIFY_BAD; | ||
650 | } | ||
651 | |||
652 | return ret; | ||
653 | } | ||
654 | |||
655 | static struct notifier_block css_reboot_notifier = { | ||
656 | .notifier_call = css_reboot_event, | ||
657 | }; | ||
658 | |||
635 | /* | 659 | /* |
636 | * Now that the driver core is running, we can setup our channel subsystem. | 660 | * Now that the driver core is running, we can setup our channel subsystem. |
637 | * The struct subchannel's are created during probing (except for the | 661 | * The struct subchannel's are created during probing (except for the |
@@ -697,12 +721,17 @@ init_channel_subsystem (void) | |||
697 | if (ret) | 721 | if (ret) |
698 | goto out_file; | 722 | goto out_file; |
699 | } | 723 | } |
724 | ret = register_reboot_notifier(&css_reboot_notifier); | ||
725 | if (ret) | ||
726 | goto out_pseudo; | ||
700 | css_init_done = 1; | 727 | css_init_done = 1; |
701 | 728 | ||
702 | ctl_set_bit(6, 28); | 729 | ctl_set_bit(6, 28); |
703 | 730 | ||
704 | for_each_subchannel(__init_channel_subsystem, NULL); | 731 | for_each_subchannel(__init_channel_subsystem, NULL); |
705 | return 0; | 732 | return 0; |
733 | out_pseudo: | ||
734 | device_unregister(&channel_subsystems[i]->pseudo_subchannel->dev); | ||
706 | out_file: | 735 | out_file: |
707 | device_remove_file(&channel_subsystems[i]->device, | 736 | device_remove_file(&channel_subsystems[i]->device, |
708 | &dev_attr_cm_enable); | 737 | &dev_attr_cm_enable); |