aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/char/sclp.h1
-rw-r--r--drivers/s390/char/sclp_cmd.c2
-rw-r--r--drivers/s390/char/sclp_early.c36
3 files changed, 16 insertions, 23 deletions
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index 6fbe09686d18..fea76aed9eea 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -183,7 +183,6 @@ extern unsigned long sclp_console_full;
183extern u8 sclp_fac84; 183extern u8 sclp_fac84;
184extern unsigned long long sclp_rzm; 184extern unsigned long long sclp_rzm;
185extern unsigned long long sclp_rnmax; 185extern unsigned long long sclp_rnmax;
186extern __initdata int sclp_early_read_info_sccb_valid;
187 186
188/* useful inlines */ 187/* useful inlines */
189 188
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index eaa21d542c5c..cb3c4e05a385 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -455,8 +455,6 @@ static int __init sclp_detect_standby_memory(void)
455 455
456 if (OLDMEM_BASE) /* No standby memory in kdump mode */ 456 if (OLDMEM_BASE) /* No standby memory in kdump mode */
457 return 0; 457 return 0;
458 if (!sclp_early_read_info_sccb_valid)
459 return 0;
460 if ((sclp_facilities & 0xe00000000000ULL) != 0xe00000000000ULL) 458 if ((sclp_facilities & 0xe00000000000ULL) != 0xe00000000000ULL)
461 return 0; 459 return 0;
462 rc = -ENOMEM; 460 rc = -ENOMEM;
diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c
index 1465e9563101..e4e5b32c52f2 100644
--- a/drivers/s390/char/sclp_early.c
+++ b/drivers/s390/char/sclp_early.c
@@ -38,8 +38,8 @@ struct read_info_sccb {
38static __initdata struct read_info_sccb early_read_info_sccb; 38static __initdata struct read_info_sccb early_read_info_sccb;
39static __initdata char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE); 39static __initdata char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE);
40static unsigned long sclp_hsa_size; 40static unsigned long sclp_hsa_size;
41static struct sclp_ipl_info sclp_ipl_info;
41 42
42__initdata int sclp_early_read_info_sccb_valid;
43u64 sclp_facilities; 43u64 sclp_facilities;
44u8 sclp_fac84; 44u8 sclp_fac84;
45unsigned long long sclp_rzm; 45unsigned long long sclp_rzm;
@@ -63,10 +63,9 @@ out:
63 return rc; 63 return rc;
64} 64}
65 65
66static void __init sclp_read_info_early(void) 66static int __init sclp_read_info_early(void)
67{ 67{
68 int rc; 68 int rc, i;
69 int i;
70 struct read_info_sccb *sccb; 69 struct read_info_sccb *sccb;
71 sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED, 70 sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED,
72 SCLP_CMDW_READ_SCP_INFO}; 71 SCLP_CMDW_READ_SCP_INFO};
@@ -83,21 +82,19 @@ static void __init sclp_read_info_early(void)
83 82
84 if (rc) 83 if (rc)
85 break; 84 break;
86 if (sccb->header.response_code == 0x10) { 85 if (sccb->header.response_code == 0x10)
87 sclp_early_read_info_sccb_valid = 1; 86 return 0;
88 break;
89 }
90 if (sccb->header.response_code != 0x1f0) 87 if (sccb->header.response_code != 0x1f0)
91 break; 88 break;
92 } 89 }
90 return -EIO;
93} 91}
94 92
95static void __init sclp_facilities_detect(void) 93static void __init sclp_facilities_detect(void)
96{ 94{
97 struct read_info_sccb *sccb; 95 struct read_info_sccb *sccb;
98 96
99 sclp_read_info_early(); 97 if (sclp_read_info_early())
100 if (!sclp_early_read_info_sccb_valid)
101 return; 98 return;
102 99
103 sccb = &early_read_info_sccb; 100 sccb = &early_read_info_sccb;
@@ -108,6 +105,12 @@ static void __init sclp_facilities_detect(void)
108 sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; 105 sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
109 sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; 106 sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
110 sclp_rzm <<= 20; 107 sclp_rzm <<= 20;
108
109 /* Save IPL information */
110 sclp_ipl_info.is_valid = 1;
111 if (sccb->flags & 0x2)
112 sclp_ipl_info.has_dump = 1;
113 memcpy(&sclp_ipl_info.loadparm, &sccb->loadparm, LOADPARM_LEN);
111} 114}
112 115
113bool __init sclp_has_linemode(void) 116bool __init sclp_has_linemode(void)
@@ -146,19 +149,12 @@ unsigned long long sclp_get_rzm(void)
146 149
147/* 150/*
148 * This function will be called after sclp_facilities_detect(), which gets 151 * This function will be called after sclp_facilities_detect(), which gets
149 * called from early.c code. Therefore the sccb should have valid contents. 152 * called from early.c code. The sclp_facilities_detect() function retrieves
153 * and saves the IPL information.
150 */ 154 */
151void __init sclp_get_ipl_info(struct sclp_ipl_info *info) 155void __init sclp_get_ipl_info(struct sclp_ipl_info *info)
152{ 156{
153 struct read_info_sccb *sccb; 157 *info = sclp_ipl_info;
154
155 if (!sclp_early_read_info_sccb_valid)
156 return;
157 sccb = &early_read_info_sccb;
158 info->is_valid = 1;
159 if (sccb->flags & 0x2)
160 info->has_dump = 1;
161 memcpy(&info->loadparm, &sccb->loadparm, LOADPARM_LEN);
162} 158}
163 159
164static int __init sclp_cmd_early(sclp_cmdw_t cmd, void *sccb) 160static int __init sclp_cmd_early(sclp_cmdw_t cmd, void *sccb)