aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index ca8e1c240c3c..a5050e217150 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * driver for channel subsystem 2 * driver for channel subsystem
3 * 3 *
4 * Copyright IBM Corp. 2002, 2009 4 * Copyright IBM Corp. 2002, 2010
5 * 5 *
6 * Author(s): Arnd Bergmann (arndb@de.ibm.com) 6 * Author(s): Arnd Bergmann (arndb@de.ibm.com)
7 * Cornelia Huck (cornelia.huck@de.ibm.com) 7 * Cornelia Huck (cornelia.huck@de.ibm.com)
@@ -577,7 +577,7 @@ static int __unset_registered(struct device *dev, void *data)
577 return 0; 577 return 0;
578} 578}
579 579
580void css_schedule_eval_all_unreg(void) 580static void css_schedule_eval_all_unreg(void)
581{ 581{
582 unsigned long flags; 582 unsigned long flags;
583 struct idset *unreg_set; 583 struct idset *unreg_set;
@@ -790,7 +790,6 @@ static struct notifier_block css_reboot_notifier = {
790static int css_power_event(struct notifier_block *this, unsigned long event, 790static int css_power_event(struct notifier_block *this, unsigned long event,
791 void *ptr) 791 void *ptr)
792{ 792{
793 void *secm_area;
794 int ret, i; 793 int ret, i;
795 794
796 switch (event) { 795 switch (event) {
@@ -806,15 +805,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
806 mutex_unlock(&css->mutex); 805 mutex_unlock(&css->mutex);
807 continue; 806 continue;
808 } 807 }
809 secm_area = (void *)get_zeroed_page(GFP_KERNEL | 808 if (__chsc_do_secm(css, 0))
810 GFP_DMA);
811 if (secm_area) {
812 if (__chsc_do_secm(css, 0, secm_area))
813 ret = NOTIFY_BAD;
814 free_page((unsigned long)secm_area);
815 } else
816 ret = NOTIFY_BAD; 809 ret = NOTIFY_BAD;
817
818 mutex_unlock(&css->mutex); 810 mutex_unlock(&css->mutex);
819 } 811 }
820 break; 812 break;
@@ -830,15 +822,8 @@ static int css_power_event(struct notifier_block *this, unsigned long event,
830 mutex_unlock(&css->mutex); 822 mutex_unlock(&css->mutex);
831 continue; 823 continue;
832 } 824 }
833 secm_area = (void *)get_zeroed_page(GFP_KERNEL | 825 if (__chsc_do_secm(css, 1))
834 GFP_DMA);
835 if (secm_area) {
836 if (__chsc_do_secm(css, 1, secm_area))
837 ret = NOTIFY_BAD;
838 free_page((unsigned long)secm_area);
839 } else
840 ret = NOTIFY_BAD; 826 ret = NOTIFY_BAD;
841
842 mutex_unlock(&css->mutex); 827 mutex_unlock(&css->mutex);
843 } 828 }
844 /* search for subchannels, which appeared during hibernation */ 829 /* search for subchannels, which appeared during hibernation */
@@ -863,14 +848,11 @@ static int __init css_bus_init(void)
863{ 848{
864 int ret, i; 849 int ret, i;
865 850
866 ret = chsc_determine_css_characteristics(); 851 ret = chsc_init();
867 if (ret == -ENOMEM)
868 goto out;
869
870 ret = chsc_alloc_sei_area();
871 if (ret) 852 if (ret)
872 goto out; 853 return ret;
873 854
855 chsc_determine_css_characteristics();
874 /* Try to enable MSS. */ 856 /* Try to enable MSS. */
875 ret = chsc_enable_facility(CHSC_SDA_OC_MSS); 857 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
876 if (ret) 858 if (ret)
@@ -956,9 +938,9 @@ out_unregister:
956 } 938 }
957 bus_unregister(&css_bus_type); 939 bus_unregister(&css_bus_type);
958out: 940out:
959 crw_unregister_handler(CRW_RSC_CSS); 941 crw_unregister_handler(CRW_RSC_SCH);
960 chsc_free_sei_area();
961 idset_free(slow_subchannel_set); 942 idset_free(slow_subchannel_set);
943 chsc_init_cleanup();
962 pr_alert("The CSS device driver initialization failed with " 944 pr_alert("The CSS device driver initialization failed with "
963 "errno=%d\n", ret); 945 "errno=%d\n", ret);
964 return ret; 946 return ret;
@@ -978,9 +960,9 @@ static void __init css_bus_cleanup(void)
978 device_unregister(&css->device); 960 device_unregister(&css->device);
979 } 961 }
980 bus_unregister(&css_bus_type); 962 bus_unregister(&css_bus_type);
981 crw_unregister_handler(CRW_RSC_CSS); 963 crw_unregister_handler(CRW_RSC_SCH);
982 chsc_free_sei_area();
983 idset_free(slow_subchannel_set); 964 idset_free(slow_subchannel_set);
965 chsc_init_cleanup();
984 isc_unregister(IO_SCH_ISC); 966 isc_unregister(IO_SCH_ISC);
985} 967}
986 968
@@ -1048,7 +1030,16 @@ subsys_initcall_sync(channel_subsystem_init_sync);
1048 1030
1049void channel_subsystem_reinit(void) 1031void channel_subsystem_reinit(void)
1050{ 1032{
1033 struct channel_path *chp;
1034 struct chp_id chpid;
1035
1051 chsc_enable_facility(CHSC_SDA_OC_MSS); 1036 chsc_enable_facility(CHSC_SDA_OC_MSS);
1037 chp_id_for_each(&chpid) {
1038 chp = chpid_to_chp(chpid);
1039 if (!chp)
1040 continue;
1041 chsc_determine_base_channel_path_desc(chpid, &chp->desc);
1042 }
1052} 1043}
1053 1044
1054#ifdef CONFIG_PROC_FS 1045#ifdef CONFIG_PROC_FS
@@ -1200,6 +1191,7 @@ static int css_pm_restore(struct device *dev)
1200 struct subchannel *sch = to_subchannel(dev); 1191 struct subchannel *sch = to_subchannel(dev);
1201 struct css_driver *drv; 1192 struct css_driver *drv;
1202 1193
1194 css_update_ssd_info(sch);
1203 if (!sch->dev.driver) 1195 if (!sch->dev.driver)
1204 return 0; 1196 return 0;
1205 drv = to_cssdriver(sch->dev.driver); 1197 drv = to_cssdriver(sch->dev.driver);