aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/chsc.c29
-rw-r--r--drivers/s390/cio/chsc_sch.c2
-rw-r--r--drivers/s390/cio/cio.c18
-rw-r--r--drivers/s390/cio/css.c16
-rw-r--r--drivers/s390/cio/device_fsm.c2
5 files changed, 33 insertions, 34 deletions
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 4038f5b4f144..ce7cb87479fe 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -29,6 +29,7 @@
29#include "chsc.h" 29#include "chsc.h"
30 30
31static void *sei_page; 31static void *sei_page;
32static DEFINE_SPINLOCK(sda_lock);
32 33
33/** 34/**
34 * chsc_error_from_response() - convert a chsc response to an error 35 * chsc_error_from_response() - convert a chsc response to an error
@@ -832,11 +833,10 @@ void __init chsc_free_sei_area(void)
832 kfree(sei_page); 833 kfree(sei_page);
833} 834}
834 835
835int __init 836int chsc_enable_facility(int operation_code)
836chsc_enable_facility(int operation_code)
837{ 837{
838 int ret; 838 int ret;
839 struct { 839 static struct {
840 struct chsc_header request; 840 struct chsc_header request;
841 u8 reserved1:4; 841 u8 reserved1:4;
842 u8 format:4; 842 u8 format:4;
@@ -849,33 +849,32 @@ chsc_enable_facility(int operation_code)
849 u32 reserved5:4; 849 u32 reserved5:4;
850 u32 format2:4; 850 u32 format2:4;
851 u32 reserved6:24; 851 u32 reserved6:24;
852 } __attribute__ ((packed)) *sda_area; 852 } __attribute__ ((packed, aligned(4096))) sda_area;
853 853
854 sda_area = (void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); 854 spin_lock(&sda_lock);
855 if (!sda_area) 855 memset(&sda_area, 0, sizeof(sda_area));
856 return -ENOMEM; 856 sda_area.request.length = 0x0400;
857 sda_area->request.length = 0x0400; 857 sda_area.request.code = 0x0031;
858 sda_area->request.code = 0x0031; 858 sda_area.operation_code = operation_code;
859 sda_area->operation_code = operation_code;
860 859
861 ret = chsc(sda_area); 860 ret = chsc(&sda_area);
862 if (ret > 0) { 861 if (ret > 0) {
863 ret = (ret == 3) ? -ENODEV : -EBUSY; 862 ret = (ret == 3) ? -ENODEV : -EBUSY;
864 goto out; 863 goto out;
865 } 864 }
866 865
867 switch (sda_area->response.code) { 866 switch (sda_area.response.code) {
868 case 0x0101: 867 case 0x0101:
869 ret = -EOPNOTSUPP; 868 ret = -EOPNOTSUPP;
870 break; 869 break;
871 default: 870 default:
872 ret = chsc_error_from_response(sda_area->response.code); 871 ret = chsc_error_from_response(sda_area.response.code);
873 } 872 }
874 if (ret != 0) 873 if (ret != 0)
875 CIO_CRW_EVENT(2, "chsc: sda (oc=%x) failed (rc=%04x)\n", 874 CIO_CRW_EVENT(2, "chsc: sda (oc=%x) failed (rc=%04x)\n",
876 operation_code, sda_area->response.code); 875 operation_code, sda_area.response.code);
877 out: 876 out:
878 free_page((unsigned long)sda_area); 877 spin_unlock(&sda_lock);
879 return ret; 878 return ret;
880} 879}
881 880
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 404f630c27ca..3b6f4adc5094 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -124,7 +124,7 @@ static int chsc_subchannel_prepare(struct subchannel *sch)
124 * since we don't have a way to clear the subchannel and 124 * since we don't have a way to clear the subchannel and
125 * cannot disable it with a request running. 125 * cannot disable it with a request running.
126 */ 126 */
127 cc = stsch(sch->schid, &schib); 127 cc = stsch_err(sch->schid, &schib);
128 if (!cc && scsw_stctl(&schib.scsw)) 128 if (!cc && scsw_stctl(&schib.scsw))
129 return -EAGAIN; 129 return -EAGAIN;
130 return 0; 130 return 0;
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index f736cdcf08ad..5feea1a371e1 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -361,7 +361,7 @@ int cio_commit_config(struct subchannel *sch)
361 struct schib schib; 361 struct schib schib;
362 int ccode, retry, ret = 0; 362 int ccode, retry, ret = 0;
363 363
364 if (stsch(sch->schid, &schib) || !css_sch_is_valid(&schib)) 364 if (stsch_err(sch->schid, &schib) || !css_sch_is_valid(&schib))
365 return -ENODEV; 365 return -ENODEV;
366 366
367 for (retry = 0; retry < 5; retry++) { 367 for (retry = 0; retry < 5; retry++) {
@@ -372,7 +372,7 @@ int cio_commit_config(struct subchannel *sch)
372 return ccode; 372 return ccode;
373 switch (ccode) { 373 switch (ccode) {
374 case 0: /* successful */ 374 case 0: /* successful */
375 if (stsch(sch->schid, &schib) || 375 if (stsch_err(sch->schid, &schib) ||
376 !css_sch_is_valid(&schib)) 376 !css_sch_is_valid(&schib))
377 return -ENODEV; 377 return -ENODEV;
378 if (cio_check_config(sch, &schib)) { 378 if (cio_check_config(sch, &schib)) {
@@ -404,7 +404,7 @@ int cio_update_schib(struct subchannel *sch)
404{ 404{
405 struct schib schib; 405 struct schib schib;
406 406
407 if (stsch(sch->schid, &schib) || !css_sch_is_valid(&schib)) 407 if (stsch_err(sch->schid, &schib) || !css_sch_is_valid(&schib))
408 return -ENODEV; 408 return -ENODEV;
409 409
410 memcpy(&sch->schib, &schib, sizeof(schib)); 410 memcpy(&sch->schib, &schib, sizeof(schib));
@@ -771,7 +771,7 @@ cio_get_console_sch_no(void)
771 if (console_irq != -1) { 771 if (console_irq != -1) {
772 /* VM provided us with the irq number of the console. */ 772 /* VM provided us with the irq number of the console. */
773 schid.sch_no = console_irq; 773 schid.sch_no = console_irq;
774 if (stsch(schid, &console_subchannel.schib) != 0 || 774 if (stsch_err(schid, &console_subchannel.schib) != 0 ||
775 (console_subchannel.schib.pmcw.st != SUBCHANNEL_TYPE_IO) || 775 (console_subchannel.schib.pmcw.st != SUBCHANNEL_TYPE_IO) ||
776 !console_subchannel.schib.pmcw.dnv) 776 !console_subchannel.schib.pmcw.dnv)
777 return -1; 777 return -1;
@@ -863,10 +863,10 @@ __disable_subchannel_easy(struct subchannel_id schid, struct schib *schib)
863 cc = 0; 863 cc = 0;
864 for (retry=0;retry<3;retry++) { 864 for (retry=0;retry<3;retry++) {
865 schib->pmcw.ena = 0; 865 schib->pmcw.ena = 0;
866 cc = msch(schid, schib); 866 cc = msch_err(schid, schib);
867 if (cc) 867 if (cc)
868 return (cc==3?-ENODEV:-EBUSY); 868 return (cc==3?-ENODEV:-EBUSY);
869 if (stsch(schid, schib) || !css_sch_is_valid(schib)) 869 if (stsch_err(schid, schib) || !css_sch_is_valid(schib))
870 return -ENODEV; 870 return -ENODEV;
871 if (!schib->pmcw.ena) 871 if (!schib->pmcw.ena)
872 return 0; 872 return 0;
@@ -913,7 +913,7 @@ static int stsch_reset(struct subchannel_id schid, struct schib *addr)
913 913
914 pgm_check_occured = 0; 914 pgm_check_occured = 0;
915 s390_base_pgm_handler_fn = cio_reset_pgm_check_handler; 915 s390_base_pgm_handler_fn = cio_reset_pgm_check_handler;
916 rc = stsch(schid, addr); 916 rc = stsch_err(schid, addr);
917 s390_base_pgm_handler_fn = NULL; 917 s390_base_pgm_handler_fn = NULL;
918 918
919 /* The program check handler could have changed pgm_check_occured. */ 919 /* The program check handler could have changed pgm_check_occured. */
@@ -950,7 +950,7 @@ static int __shutdown_subchannel_easy(struct subchannel_id schid, void *data)
950 /* No default clear strategy */ 950 /* No default clear strategy */
951 break; 951 break;
952 } 952 }
953 stsch(schid, &schib); 953 stsch_err(schid, &schib);
954 __disable_subchannel_easy(schid, &schib); 954 __disable_subchannel_easy(schid, &schib);
955 } 955 }
956out: 956out:
@@ -1086,7 +1086,7 @@ int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo)
1086 schid = *(struct subchannel_id *)&S390_lowcore.subchannel_id; 1086 schid = *(struct subchannel_id *)&S390_lowcore.subchannel_id;
1087 if (!schid.one) 1087 if (!schid.one)
1088 return -ENODEV; 1088 return -ENODEV;
1089 if (stsch(schid, &schib)) 1089 if (stsch_err(schid, &schib))
1090 return -ENODEV; 1090 return -ENODEV;
1091 if (schib.pmcw.st != SUBCHANNEL_TYPE_IO) 1091 if (schib.pmcw.st != SUBCHANNEL_TYPE_IO)
1092 return -ENODEV; 1092 return -ENODEV;
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 2769da54f2b9..511649115bd7 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -870,15 +870,10 @@ static int __init css_bus_init(void)
870 870
871 /* Try to enable MSS. */ 871 /* Try to enable MSS. */
872 ret = chsc_enable_facility(CHSC_SDA_OC_MSS); 872 ret = chsc_enable_facility(CHSC_SDA_OC_MSS);
873 switch (ret) { 873 if (ret)
874 case 0: /* Success. */
875 max_ssid = __MAX_SSID;
876 break;
877 case -ENOMEM:
878 goto out;
879 default:
880 max_ssid = 0; 874 max_ssid = 0;
881 } 875 else /* Success. */
876 max_ssid = __MAX_SSID;
882 877
883 ret = slow_subchannel_init(); 878 ret = slow_subchannel_init();
884 if (ret) 879 if (ret)
@@ -1048,6 +1043,11 @@ static int __init channel_subsystem_init_sync(void)
1048} 1043}
1049subsys_initcall_sync(channel_subsystem_init_sync); 1044subsys_initcall_sync(channel_subsystem_init_sync);
1050 1045
1046void channel_subsystem_reinit(void)
1047{
1048 chsc_enable_facility(CHSC_SDA_OC_MSS);
1049}
1050
1051#ifdef CONFIG_PROC_FS 1051#ifdef CONFIG_PROC_FS
1052static ssize_t cio_settle_write(struct file *file, const char __user *buf, 1052static ssize_t cio_settle_write(struct file *file, const char __user *buf,
1053 size_t count, loff_t *ppos) 1053 size_t count, loff_t *ppos)
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index c56ab94612f9..c9b852647f01 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -45,7 +45,7 @@ static void ccw_timeout_log(struct ccw_device *cdev)
45 sch = to_subchannel(cdev->dev.parent); 45 sch = to_subchannel(cdev->dev.parent);
46 private = to_io_private(sch); 46 private = to_io_private(sch);
47 orb = &private->orb; 47 orb = &private->orb;
48 cc = stsch(sch->schid, &schib); 48 cc = stsch_err(sch->schid, &schib);
49 49
50 printk(KERN_WARNING "cio: ccw device timeout occurred at %llx, " 50 printk(KERN_WARNING "cio: ccw device timeout occurred at %llx, "
51 "device information:\n", get_clock()); 51 "device information:\n", get_clock());