qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] s390x/css: fix cc handling for XSCH
@ 2017-08-31 12:18 Halil Pasic
  2017-08-31 12:53 ` Thomas Huth
  2017-08-31 13:24 ` Cornelia Huck
  0 siblings, 2 replies; 3+ messages in thread
From: Halil Pasic @ 2017-08-31 12:18 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Dong Jia Shi, Pierre Morel, Thomas Huth, qemu-devel, Halil Pasic

The function ioinst_handle_xsch is presenting cc 2 when it's supposed to
present cc 1 and the other way around, because css_do_xsch has the error
codes mixed up. Because cc 1 has precedence over cc 2 we also have to
swap the two checks.

Let us fix this.

Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reported-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
---

Was previously a part of a series (due to an accident the
series had no name). This version also fixes the priority
(aka precedence) problem.

---
 hw/s390x/css.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 1880b1a0ff..e04e0ea3a8 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -1276,16 +1276,16 @@ int css_do_xsch(SubchDev *sch)
         goto out;
     }
 
+    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
+        ret = -EINPROGRESS;
+        goto out;
+    }
+
     if (!(s->ctrl & SCSW_CTRL_MASK_FCTL) ||
         ((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||
         (!(s->ctrl &
            (SCSW_ACTL_RESUME_PEND | SCSW_ACTL_START_PEND | SCSW_ACTL_SUSP))) ||
         (s->ctrl & SCSW_ACTL_SUBCH_ACTIVE)) {
-        ret = -EINPROGRESS;
-        goto out;
-    }
-
-    if (s->ctrl & SCSW_CTRL_MASK_STCTL) {
         ret = -EBUSY;
         goto out;
     }
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-31 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-31 12:18 [Qemu-devel] [PATCH 1/1] s390x/css: fix cc handling for XSCH Halil Pasic
2017-08-31 12:53 ` Thomas Huth
2017-08-31 13:24 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).