aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2007-10-12 10:11:20 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-10-12 10:13:00 -0400
commita55360df406cca797ac07d722688dd7ec29bf46e (patch)
tree442ef578c5af203312fbbbf1f217b258316cd158 /drivers/s390
parenta0ea22c3d912de6044f83b07dcc26ee006106139 (diff)
[S390] cio: Disable channel path measurements on shutdown/reboot.
Make sure channel path measurements are disabled via a reboot notifier since we cannot rely on userspace to disable it again after enabling it. This is 1. clean and 2. makes sure that channel path measurements do not stay enabled after a reboot not involving a subsystem reset (which would lead to the channel subsystem scribbling onto random memory). Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/css.c29
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
636static 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
655static 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;
733out_pseudo:
734 device_unregister(&channel_subsystems[i]->pseudo_subchannel->dev);
706out_file: 735out_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);