s390/sclp_early: Get rid of sclp_early_read_info_sccb_valid

The early sclp detect functions gather the available SCLP facility
information. The sclp_early_read_info_sccb_valid indicates whether the
early sclp request was valid.  However, one external reference to it
checks for particular sclp facility bits and this should be sufficient.
Another occurance is in the sclp_get_ipl_info() function that is called
later.  Because all information are available at the early stage, save
the ipl information when detecting the sclp facilities.  Hence, no more
checks for sclp_early_read_info_sccb_valid are required.

Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
Reviewed-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Hendrik Brueckner 2013-12-05 18:46:51 +01:00 коммит произвёл Martin Schwidefsky
Родитель 41932bc1c8
Коммит 333cce91f3
3 изменённых файлов: 16 добавлений и 23 удалений

Просмотреть файл

@ -183,7 +183,6 @@ extern unsigned long sclp_console_full;
extern u8 sclp_fac84; extern u8 sclp_fac84;
extern unsigned long long sclp_rzm; extern unsigned long long sclp_rzm;
extern unsigned long long sclp_rnmax; extern unsigned long long sclp_rnmax;
extern __initdata int sclp_early_read_info_sccb_valid;
/* useful inlines */ /* useful inlines */

Просмотреть файл

@ -455,8 +455,6 @@ static int __init sclp_detect_standby_memory(void)
if (OLDMEM_BASE) /* No standby memory in kdump mode */ if (OLDMEM_BASE) /* No standby memory in kdump mode */
return 0; return 0;
if (!sclp_early_read_info_sccb_valid)
return 0;
if ((sclp_facilities & 0xe00000000000ULL) != 0xe00000000000ULL) if ((sclp_facilities & 0xe00000000000ULL) != 0xe00000000000ULL)
return 0; return 0;
rc = -ENOMEM; rc = -ENOMEM;

Просмотреть файл

@ -38,8 +38,8 @@ struct read_info_sccb {
static __initdata struct read_info_sccb early_read_info_sccb; static __initdata struct read_info_sccb early_read_info_sccb;
static __initdata char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE); static __initdata char sccb_early[PAGE_SIZE] __aligned(PAGE_SIZE);
static unsigned long sclp_hsa_size; static unsigned long sclp_hsa_size;
static struct sclp_ipl_info sclp_ipl_info;
__initdata int sclp_early_read_info_sccb_valid;
u64 sclp_facilities; u64 sclp_facilities;
u8 sclp_fac84; u8 sclp_fac84;
unsigned long long sclp_rzm; unsigned long long sclp_rzm;
@ -63,10 +63,9 @@ out:
return rc; return rc;
} }
static void __init sclp_read_info_early(void) static int __init sclp_read_info_early(void)
{ {
int rc; int rc, i;
int i;
struct read_info_sccb *sccb; struct read_info_sccb *sccb;
sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED, sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED,
SCLP_CMDW_READ_SCP_INFO}; SCLP_CMDW_READ_SCP_INFO};
@ -83,21 +82,19 @@ static void __init sclp_read_info_early(void)
if (rc) if (rc)
break; break;
if (sccb->header.response_code == 0x10) { if (sccb->header.response_code == 0x10)
sclp_early_read_info_sccb_valid = 1; return 0;
break;
}
if (sccb->header.response_code != 0x1f0) if (sccb->header.response_code != 0x1f0)
break; break;
} }
return -EIO;
} }
static void __init sclp_facilities_detect(void) static void __init sclp_facilities_detect(void)
{ {
struct read_info_sccb *sccb; struct read_info_sccb *sccb;
sclp_read_info_early(); if (sclp_read_info_early())
if (!sclp_early_read_info_sccb_valid)
return; return;
sccb = &early_read_info_sccb; sccb = &early_read_info_sccb;
@ -108,6 +105,12 @@ static void __init sclp_facilities_detect(void)
sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
sclp_rzm <<= 20; sclp_rzm <<= 20;
/* Save IPL information */
sclp_ipl_info.is_valid = 1;
if (sccb->flags & 0x2)
sclp_ipl_info.has_dump = 1;
memcpy(&sclp_ipl_info.loadparm, &sccb->loadparm, LOADPARM_LEN);
} }
bool __init sclp_has_linemode(void) bool __init sclp_has_linemode(void)
@ -146,19 +149,12 @@ unsigned long long sclp_get_rzm(void)
/* /*
* This function will be called after sclp_facilities_detect(), which gets * This function will be called after sclp_facilities_detect(), which gets
* called from early.c code. Therefore the sccb should have valid contents. * called from early.c code. The sclp_facilities_detect() function retrieves
* and saves the IPL information.
*/ */
void __init sclp_get_ipl_info(struct sclp_ipl_info *info) void __init sclp_get_ipl_info(struct sclp_ipl_info *info)
{ {
struct read_info_sccb *sccb; *info = sclp_ipl_info;
if (!sclp_early_read_info_sccb_valid)
return;
sccb = &early_read_info_sccb;
info->is_valid = 1;
if (sccb->flags & 0x2)
info->has_dump = 1;
memcpy(&info->loadparm, &sccb->loadparm, LOADPARM_LEN);
} }
static int __init sclp_cmd_early(sclp_cmdw_t cmd, void *sccb) static int __init sclp_cmd_early(sclp_cmdw_t cmd, void *sccb)