Skip to content

Commit

Permalink
s390/sclp_early: Get rid of sclp_early_read_info_sccb_valid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hendrik Brueckner authored and Martin Schwidefsky committed Dec 16, 2013
1 parent 41932bc commit 333cce9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
1 change: 0 additions & 1 deletion drivers/s390/char/sclp.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ extern unsigned long sclp_console_full;
extern u8 sclp_fac84;
extern unsigned long long sclp_rzm;
extern unsigned long long sclp_rnmax;
extern __initdata int sclp_early_read_info_sccb_valid;

/* useful inlines */

Expand Down
2 changes: 0 additions & 2 deletions drivers/s390/char/sclp_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ static int __init sclp_detect_standby_memory(void)

if (OLDMEM_BASE) /* No standby memory in kdump mode */
return 0;
if (!sclp_early_read_info_sccb_valid)
return 0;
if ((sclp_facilities & 0xe00000000000ULL) != 0xe00000000000ULL)
return 0;
rc = -ENOMEM;
Expand Down
36 changes: 16 additions & 20 deletions drivers/s390/char/sclp_early.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ struct read_info_sccb {
static __initdata struct read_info_sccb early_read_info_sccb;
static __initdata char sccb_early[PAGE_SIZE] __aligned(PAGE_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;
u8 sclp_fac84;
unsigned long long sclp_rzm;
Expand All @@ -63,10 +63,9 @@ static int __init sclp_cmd_sync_early(sclp_cmdw_t cmd, void *sccb)
return rc;
}

static void __init sclp_read_info_early(void)
static int __init sclp_read_info_early(void)
{
int rc;
int i;
int rc, i;
struct read_info_sccb *sccb;
sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED,
SCLP_CMDW_READ_SCP_INFO};
Expand All @@ -83,21 +82,19 @@ static void __init sclp_read_info_early(void)

if (rc)
break;
if (sccb->header.response_code == 0x10) {
sclp_early_read_info_sccb_valid = 1;
break;
}
if (sccb->header.response_code == 0x10)
return 0;
if (sccb->header.response_code != 0x1f0)
break;
}
return -EIO;
}

static void __init sclp_facilities_detect(void)
{
struct read_info_sccb *sccb;

sclp_read_info_early();
if (!sclp_early_read_info_sccb_valid)
if (sclp_read_info_early())
return;

sccb = &early_read_info_sccb;
Expand All @@ -108,6 +105,12 @@ static void __init sclp_facilities_detect(void)
sclp_rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2;
sclp_rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2;
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)
Expand Down Expand Up @@ -146,19 +149,12 @@ unsigned long long sclp_get_rzm(void)

/*
* 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)
{
struct read_info_sccb *sccb;

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);
*info = sclp_ipl_info;
}

static int __init sclp_cmd_early(sclp_cmdw_t cmd, void *sccb)
Expand Down

0 comments on commit 333cce9

Please sign in to comment.