aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/cio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/cio.c')
-rw-r--r--drivers/s390/cio/cio.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 89ced3408138..f16c15c13f6e 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -406,8 +406,8 @@ cio_modify (struct subchannel *sch)
406/* 406/*
407 * Enable subchannel. 407 * Enable subchannel.
408 */ 408 */
409int 409int cio_enable_subchannel(struct subchannel *sch, unsigned int isc,
410cio_enable_subchannel (struct subchannel *sch, unsigned int isc) 410 u32 intparm)
411{ 411{
412 char dbf_txt[15]; 412 char dbf_txt[15];
413 int ccode; 413 int ccode;
@@ -426,7 +426,7 @@ cio_enable_subchannel (struct subchannel *sch, unsigned int isc)
426 for (retry = 5, ret = 0; retry > 0; retry--) { 426 for (retry = 5, ret = 0; retry > 0; retry--) {
427 sch->schib.pmcw.ena = 1; 427 sch->schib.pmcw.ena = 1;
428 sch->schib.pmcw.isc = isc; 428 sch->schib.pmcw.isc = isc;
429 sch->schib.pmcw.intparm = (u32)(addr_t)sch; 429 sch->schib.pmcw.intparm = intparm;
430 ret = cio_modify(sch); 430 ret = cio_modify(sch);
431 if (ret == -ENODEV) 431 if (ret == -ENODEV)
432 break; 432 break;
@@ -577,11 +577,8 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid)
577 } 577 }
578 578
579 /* Initialization for io subchannels. */ 579 /* Initialization for io subchannels. */
580 if (!sch->schib.pmcw.dnv) { 580 if (!css_sch_is_valid(&sch->schib))
581 /* io subchannel but device number is invalid. */ 581 return -ENODEV;
582 err = -ENODEV;
583 goto out;
584 }
585 /* Devno is valid. */ 582 /* Devno is valid. */
586 if (is_blacklisted (sch->schid.ssid, sch->schib.pmcw.dev)) { 583 if (is_blacklisted (sch->schid.ssid, sch->schib.pmcw.dev)) {
587 /* 584 /*
@@ -745,9 +742,9 @@ cio_test_for_console(struct subchannel_id schid, void *data)
745{ 742{
746 if (stsch_err(schid, &console_subchannel.schib) != 0) 743 if (stsch_err(schid, &console_subchannel.schib) != 0)
747 return -ENXIO; 744 return -ENXIO;
748 if (console_subchannel.schib.pmcw.dnv && 745 if ((console_subchannel.schib.pmcw.st == SUBCHANNEL_TYPE_IO) &&
749 console_subchannel.schib.pmcw.dev == 746 console_subchannel.schib.pmcw.dnv &&
750 console_devno) { 747 (console_subchannel.schib.pmcw.dev == console_devno)) {
751 console_irq = schid.sch_no; 748 console_irq = schid.sch_no;
752 return 1; /* found */ 749 return 1; /* found */
753 } 750 }
@@ -765,6 +762,7 @@ cio_get_console_sch_no(void)
765 /* VM provided us with the irq number of the console. */ 762 /* VM provided us with the irq number of the console. */
766 schid.sch_no = console_irq; 763 schid.sch_no = console_irq;
767 if (stsch(schid, &console_subchannel.schib) != 0 || 764 if (stsch(schid, &console_subchannel.schib) != 0 ||
765 (console_subchannel.schib.pmcw.st != SUBCHANNEL_TYPE_IO) ||
768 !console_subchannel.schib.pmcw.dnv) 766 !console_subchannel.schib.pmcw.dnv)
769 return -1; 767 return -1;
770 console_devno = console_subchannel.schib.pmcw.dev; 768 console_devno = console_subchannel.schib.pmcw.dev;
@@ -1029,7 +1027,7 @@ static int __reipl_subchannel_match(struct subchannel_id schid, void *data)
1029 1027
1030 if (stsch_reset(schid, &schib)) 1028 if (stsch_reset(schid, &schib))
1031 return -ENXIO; 1029 return -ENXIO;
1032 if (schib.pmcw.dnv && 1030 if ((schib.pmcw.st == SUBCHANNEL_TYPE_IO) && schib.pmcw.dnv &&
1033 (schib.pmcw.dev == match_id->devid.devno) && 1031 (schib.pmcw.dev == match_id->devid.devno) &&
1034 (schid.ssid == match_id->devid.ssid)) { 1032 (schid.ssid == match_id->devid.ssid)) {
1035 match_id->schid = schid; 1033 match_id->schid = schid;
@@ -1075,6 +1073,8 @@ int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo)
1075 return -ENODEV; 1073 return -ENODEV;
1076 if (stsch(schid, &schib)) 1074 if (stsch(schid, &schib))
1077 return -ENODEV; 1075 return -ENODEV;
1076 if (schib.pmcw.st != SUBCHANNEL_TYPE_IO)
1077 return -ENODEV;
1078 if (!schib.pmcw.dnv) 1078 if (!schib.pmcw.dnv)
1079 return -ENODEV; 1079 return -ENODEV;
1080 iplinfo->devno = schib.pmcw.dev; 1080 iplinfo->devno = schib.pmcw.dev;