diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-02-02 12:33:03 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2017-02-08 14:13:21 +0100 |
commit | f694bb3a36a8113addd31817e4b5aca42326353d (patch) | |
tree | ea99bbb43adba384a822788b6bf0067c9a6b7405 /drivers/s390/char | |
parent | 02407baaebdef86571e4e939ddbd3b32d9b5d389 (diff) | |
download | linux-stable-f694bb3a36a8113addd31817e4b5aca42326353d.tar.gz linux-stable-f694bb3a36a8113addd31817e4b5aca42326353d.tar.bz2 linux-stable-f694bb3a36a8113addd31817e4b5aca42326353d.zip |
s390/sclp: get rid of common response code handling
Get rid of common response code handling. Each command requires its
own response code handling anyway. Also the retry in case of -EBUSY
does not work and can be simply removed.
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char')
-rw-r--r-- | drivers/s390/char/sclp.h | 1 | ||||
-rw-r--r-- | drivers/s390/char/sclp_early.c | 27 | ||||
-rw-r--r-- | drivers/s390/char/sclp_early_core.c | 22 |
3 files changed, 17 insertions, 33 deletions
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h index 78d5f542d979..53b5d1b9761a 100644 --- a/drivers/s390/char/sclp.h +++ b/drivers/s390/char/sclp.h @@ -224,7 +224,6 @@ extern unsigned long sclp_console_full; extern char sclp_early_sccb[PAGE_SIZE]; void sclp_early_wait_irq(void); -int sclp_early_cmd_sync(sclp_cmdw_t cmd, void *sccb); int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb); unsigned int sclp_early_con_check_linemode(struct init_sccb *sccb); int sclp_early_set_event_mask(struct init_sccb *sccb, diff --git a/drivers/s390/char/sclp_early.c b/drivers/s390/char/sclp_early.c index 2f9e50379e64..519ec1787117 100644 --- a/drivers/s390/char/sclp_early.c +++ b/drivers/s390/char/sclp_early.c @@ -62,20 +62,16 @@ EXPORT_SYMBOL(sclp); static int __init sclp_early_read_info(struct read_info_sccb *sccb) { - int rc, i; + int i; sclp_cmdw_t commands[] = {SCLP_CMDW_READ_SCP_INFO_FORCED, SCLP_CMDW_READ_SCP_INFO}; for (i = 0; i < ARRAY_SIZE(commands); i++) { - do { - memset(sccb, 0, sizeof(*sccb)); - sccb->header.length = sizeof(*sccb); - sccb->header.function_code = 0x80; - sccb->header.control_mask[2] = 0x80; - rc = sclp_early_cmd_sync(commands[i], sccb); - } while (rc == -EBUSY); - - if (rc) + memset(sccb, 0, sizeof(*sccb)); + sccb->header.length = sizeof(*sccb); + sccb->header.function_code = 0x80; + sccb->header.control_mask[2] = 0x80; + if (sclp_early_cmd(commands[i], sccb)) break; if (sccb->header.response_code == 0x10) return 0; @@ -167,16 +163,11 @@ static int sclp_early_core_info_valid __initdata; static void __init sclp_early_init_core_info(struct read_cpu_info_sccb *sccb) { - int rc; - if (!SCLP_HAS_CPU_INFO) return; memset(sccb, 0, sizeof(*sccb)); sccb->header.length = sizeof(*sccb); - do { - rc = sclp_early_cmd_sync(SCLP_CMDW_READ_CPU_INFO, sccb); - } while (rc == -EBUSY); - if (rc) + if (sclp_early_cmd(SCLP_CMDW_READ_CPU_INFO, sccb)) return; if (sccb->header.response_code != 0x0010) return; @@ -204,6 +195,8 @@ static long __init sclp_early_hsa_size_init(struct sdias_sccb *sccb) sccb->evbuf.dbs = 1; if (sclp_early_cmd(SCLP_CMDW_WRITE_EVENT_DATA, sccb)) return -EIO; + if (sccb->hdr.response_code != 0x20) + return -EIO; if (sccb->evbuf.blk_cnt == 0) return 0; return (sccb->evbuf.blk_cnt - 1) * PAGE_SIZE; @@ -215,6 +208,8 @@ static long __init sclp_early_hsa_copy_wait(struct sdias_sccb *sccb) sccb->hdr.length = PAGE_SIZE; if (sclp_early_cmd(SCLP_CMDW_READ_EVENT_DATA, sccb)) return -EIO; + if ((sccb->hdr.response_code != 0x20) && (sccb->hdr.response_code != 0x220)) + return -EIO; if (sccb->evbuf.blk_cnt == 0) return 0; return (sccb->evbuf.blk_cnt - 1) * PAGE_SIZE; diff --git a/drivers/s390/char/sclp_early_core.c b/drivers/s390/char/sclp_early_core.c index cc3ad8c69a7a..5029cc87e80f 100644 --- a/drivers/s390/char/sclp_early_core.c +++ b/drivers/s390/char/sclp_early_core.c @@ -50,7 +50,7 @@ void sclp_early_wait_irq(void) __ctl_load(cr0.val, 0, 0); } -int sclp_early_cmd_sync(sclp_cmdw_t cmd, void *sccb) +int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb) { unsigned long flags; int rc; @@ -65,20 +65,6 @@ out: return rc; } -int sclp_early_cmd(sclp_cmdw_t cmd, void *sccb) -{ - int rc; - - do { - rc = sclp_early_cmd_sync(cmd, sccb); - } while (rc == -EBUSY); - if (rc) - return -EIO; - if (((struct sccb_header *) sccb)->response_code != 0x0020) - return -EIO; - return 0; -} - struct write_sccb { struct sccb_header header; struct msg_buf msg; @@ -163,7 +149,11 @@ int sclp_early_set_event_mask(struct init_sccb *sccb, sccb->mask_length = sizeof(sccb_mask_t); sccb->receive_mask = receive_mask; sccb->send_mask = send_mask; - return sclp_early_cmd(SCLP_CMDW_WRITE_EVENT_MASK, sccb); + if (sclp_early_cmd(SCLP_CMDW_WRITE_EVENT_MASK, sccb)) + return -EIO; + if (sccb->header.response_code != 0x20) + return -EIO; + return 0; } unsigned int sclp_early_con_check_linemode(struct init_sccb *sccb) |